finishing game logic