refactored gameOver to remove IO; minor changes to loop to work with this