game logic fully working