game logic implemented