     // Because we are aggregating found and lost peers in order
     // to get nearby peers, we should start with a clean slate when
     // browsing is kicked off again.
-    rx_nearbyPeers.value = []
+    _nearbyPeers.value = []
   }
 
   public func connect(peer: MCPeerID, context: [String: AnyObject]?, timeout: NSTimeInterval) {

                      withDiscoveryInfo info: [String: String]?) {
    // Get a unique list of peers
    var result: [(MCPeerID, [String: String]?)] = []
    for o in (self.rx_nearbyPeers.value + [(peerId, info)]) {
      if (result.map { $0.0 }).indexOf(o.0) == nil {
        result = result + [o]
      }
    }

    self.rx_nearbyPeers.value = result
  }

  public func browser(browser: MCNearbyServiceBrowser,
                      lostPeer peerId: MCPeerID) {
    self.rx_nearbyPeers.value = self.rx_nearbyPeers.value.filter { (id, _) in
      id != peerId
    }
  }

  public func browser(browser: MCNearbyServiceBrowser,
                      didNotStartBrowsingForPeers err: NSError) {
    rx_connectionErrors.on(.Next(err))
  }

}


  private let disposeBag = DisposeBag()

  private let advertiser: MCNearbyServiceAdvertiser
  private let browser: MCNearbyServiceBrowser

  private let _connectedPeer: PublishSubject<MCPeerID> = PublishSubject()
  private let _disconnectedPeer: PublishSubject<MCPeerID> = PublishSubject()
  private let _incomingConnections: PublishSubject<(MCPeerID, [String: AnyObject]?, (Bool, MCSession) -> Void)> = PublishSubject()
  private let _connections = Variable<[MCPeerID]>([])
  private let _nearbyPeers: Variable<[(MCPeerID, [String: String]?)]> = Variable([])
  private let _connectionErrors: PublishSubject<NSError> = PublishSubject()
  private let _receivedData: PublishSubject<(MCPeerID, NSData)> = PublishSubject()
  private let _receivedResource: PublishSubject<(MCPeerID, String, ResourceState)> = PublishSubject()
  private let _receivedStreams = PublishSubject<(MCPeerID, String, NSInputStream)>()

  public var iden: MCPeerID { return session.myPeerID }
  public var meta: [String: String]? { return self.advertiser.discoveryInfo }
