     func browser(browser: MCNearbyServiceBrowser, foundPeer peerID: MCPeerID, withDiscoveryInfo info: [String : String]?) {
         let remotePeerName = peerID.displayName
         
-        NSLog("Browser found %@", remotePeerName)
-        
         if let myPeerID = session?.myPeerID {
         
             let shouldInvite = (myPeerID.displayName.compare(remotePeerName) == .OrderedDescending)
             
             if (shouldInvite) {
-                NSLog("Inviting %@", remotePeerName)
+                NSLog("%@ Inviting [%@]", __FUNCTION__, remotePeerName)
                 browser.invitePeer(peerID, toSession: session!, withContext: nil, timeout: 30.0)
             }
             else {
-                NSLog("Not inviting %@", remotePeerName)
+                NSLog("%@ Not inviting [%@]", __FUNCTION__, remotePeerName)
             }
-        }
-        
-        delegate?.sessionDidChangeState()
+            
+            delegate?.sessionDidChangeState()
+        }
     }
     
     func browser(browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) {
-        NSLog("lostPeer %@", peerID.displayName)
-        
         connectingPeersOrderedSet.removeObject(peerID)
         disconnectedPeersOrderedSet.addObject(peerID)
         
         delegate?.sessionDidChangeState()
+        NSLog("%@ lostPeer [%@]", __FUNCTION__, peerID.displayName)
     }
 
     func browser(browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: NSError) {
-        NSLog("didNotStartBrowsingForPeers: %@", error)
+        NSLog("%@ %@", __FUNCTION__, error)
     }
 
     // MARK: MCNearbyServiceAdvertiserDelegate protocol conformance
 
     func advertiser(advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: NSData?, invitationHandler: (Bool, MCSession) -> Void) {
-        NSLog("didReceiveInvitationFromPeer %@", peerID.displayName)
+        NSLog("%@ Accepting invitation from [%@]", __FUNCTION__, peerID.displayName)
         
         invitationHandler(true, session!)
-        
-        connectingPeersOrderedSet.addObject(peerID)
-        disconnectedPeersOrderedSet.removeObject(peerID)
-        
-        delegate?.sessionDidChangeState()
     }
 
     func advertiser(advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: NSError) {
-        NSLog("didNotStartAdvertisingForPeers: %@", error)
+        NSLog("%@ %@", __FUNCTION__, error)
     }
 
 }

    }

    // MARK: MCSessionDelegate protocol conformance
    
    func session(session: MCSession, didReceiveCertificate certificate: [AnyObject]?, fromPeer peerID: MCPeerID, certificateHandler: (Bool) -> Void) {
        certificateHandler(true)
    }

    func session(session: MCSession, peer peerID: MCPeerID, didChangeState state: MCSessionState) {
        NSLog("Peer [%@] changed state to %@", peerID.displayName, MCSession.stringForPeerConnectionState(state))
        
        switch state {
        case .Connecting:
            connectingPeersOrderedSet.addObject(peerID)

    }
    
    func session(session: MCSession, didReceiveData data: NSData, fromPeer peerID: MCPeerID) {
        NSLog("%@ from [%@]", __FUNCTION__, peerID.displayName)
    }
    
    func session(session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, withProgress progress: NSProgress) {
        NSLog("%@ [%@] from %@ with progress [%@]", __FUNCTION__, resourceName, peerID.displayName, progress)
    }
    
    func session(session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, atURL localURL: NSURL, withError error: NSError?) {
        // If error is not nil something went wrong
        if (error != nil) {
            NSLog("%@ Error %@ from [%@]", __FUNCTION__, error!, peerID.displayName)
        }
        else {
            NSLog("%@ %@ from [%@]", __FUNCTION__, resourceName, peerID.displayName)
        }
    }

    // Streaming API not utilized in this sample code
    func session(session: MCSession, didReceiveStream stream: NSInputStream, withName streamName: String, fromPeer peerID: MCPeerID) {
        NSLog("%@ %@ from [%@]", __FUNCTION__, streamName, peerID.displayName)
    }

    // MARK: MCNearbyServiceBrowserDelegate protocol conformance
