Finished endGame() function.  Now a fully working game.  Optimizations still required for maximum performance.