Completed code for the game for #1.