Added endGame functionality
Added endGame functionality