Added logic to detect end of game

Updated tester to play entire games to the end