Documented the program and finished the game logic.