End of game logic.