completed the majority of game logic