move game and win/lose conditions into methods to make them testable