closer to production!

added more logic to fix ending of game, and fixed #2