main game logic implemented