Made a few minor changes

Added better end game function