implementing the game