complete the logic of the game