complete the game logic