implemented basic game logic