Began implementation of endGame function.