Added pausing, quitting, and resetting. Also implemented the end-game rule.