improved all game logic