complete game logic