 
     var reachedDiscoveryLimit: Bool {
         return self.peripheralConnectionStatus.count >= ConfigStore.getMaximumPeripheralsDiscovered()
+    }
+
+    var peripheralsSortedByRSSI: [BCPeripheral] {
+        return Singletons.centralManager.peripherals.sort() { (p1, p2) -> Bool in
+            return p1.RSSI >= p2.RSSI
+        }
     }
 
     struct MainStoryboard {

    }
    
    func setScanButton() {
        if Singletons.centralManager.isScanning || Singletons.timedScannerator.isScanning {
            self.navigationItem.setLeftBarButtonItem(self.stopScanBarButtonItem, animated:false)
        } else {
            self.navigationItem.setLeftBarButtonItem(self.startScanBarButtonItem, animated:false)

                peripheral.stopPollingRSSI()
                self.rssiPollingFutures.removeValueForKey(peripheral.identifier)
                self.peripheralConnectionStatus.removeValueForKey(peripheral.identifier)
                peripheral.terminate()
                self.startScan()
                self.updateWhenActive()
            }
        }
