some small changes, should be able to end the game and restart now, not tested yet.