implementing game lifecycle (nearly done)