Implemented a bunch more game logic.

Implemented a bunch more game logic.