Fixed endGame check!!

Finally got this bug fixed and plan to do more general organizational
things like putting code in packages.