improve game logic