     private var serviceBrowser: MCNearbyServiceBrowser?
     private var foundHosts = [MCPeerID]()
     
-    // A set of all peers in the session.
-    // We need this since session.connectedPeers only contains peers except self.
-    // Useful for discovering disconnection.
-    private var peersInSession: Set<MCPeerID>
-    
     public weak var delegate: CoulombNetworkDelegate?
     
     private lazy var session: MCSessionWithHost = {

                if state == .Connected {
                    NSLog("%@", "connected to \(session.hashValue)")
                    // Update the set of peers in the session
                    peersInSession.insert(peerID)
                    
                    // If currently a guest, stop looking for host
                    stopSearchingForHosts()

                    delegate?.connectedToPeer(peerID)
                } else {
                    NSLog("%@", "not connected to \(session.hashValue)")
                    NSLog("%@", "peersInSession \(self.session.peersInSession)")
                    
                    // If session.connectedPeers is empty, it implies that either:
                    // - Self is disconnected from the session
                    // - The session has no other connected peer
                    // Combine with peersInSession count > 1, we can be certain that
                    // self is disconnected.
                    if self.session.connectedPeers.isEmpty && self.session.peersInSession.count > 1 {
                        NSLog("%@", "Self was removed")
                        self.session.peersInSession.remove(myPeerId)
                        delegate?.disconnectedFromSession()
                    } else {
                        NSLog("%@", "Self was not removed")
                        NSLog("%@", "Current host: \(self.session.host)")
                        
                        // Assign a new host as the first item in peersInSession set that is not the old host
                        // If the current item is the next in line, convert it to a host
                        if self.session.host == peerID {
                            var nextHost = peerID
                            for peer in self.session.peersInSession {
                                if peer != peerID {
                                    nextHost = peer
                                    break
                                }
                            }
                            NSLog("%@", "Next potential host: \(nextHost)")
                            
                            if myPeerId == nextHost {
                                NSLog("%@", "my peer is the next host")
                                // Convert current item into a host
                                self.session.host = myPeerId
                                NSLog("%@", "New host \(self.session.host?.displayName)")
                                stopSearchingForHosts()
                                startAdvertisingHost()
                            }
                        }
                    }
                }
                
