 
     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 {

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

    var stopScanBarButtonItem: UIBarButtonItem!
    var startScanBarButtonItem: UIBarButtonItem!

    var scanStatus = false
    var rssiPollingFutures = [NSUUID: (future: FutureStream<Int>, cellUpdate: Bool)]()
    var peripheralConnectionStatus = [NSUUID: PeripheralConnectionStatus]()

