finishes game logic