     
     func gameEndSignalReceived(data: AnyObject?, peer: MCPeerID) {
         // Stop the update() method
+        print("game end signal received")
         state.gameIsOver = true
     }
     

    
    func update() {
        guard !state.gameIsOver else {
            return
        }
        updateEventQueue()

    
    func handlePlayerCollisionEvent(player: Player, xCoordinate: Int?) {
        player.run()
        let validToSend = isValidToSend(player)
        
        if player.playerNumber == state.myPlayer.playerNumber {
            player.fallBehind()
            state.addCollideEvent(timeStep, xCoordinate: player.xCoordinate)
            player.becomeInvulnerable(timeStep)
            if validToSend {
                sendCollisionData(player.xCoordinate)
            }
            // If player fell off the grid, he finished the race
            if player.xCoordinate < 0 {
                state.updatePlayerScore(myPeerID, score: score)
                
                if validToSend {
                    sendPlayerLostData(score)
                }
                
                player.lost()

                checkRaceFinished()
            }
        } else {
