game logic in main