Introduced end of game logic.