Completed implementation of the game