moved declarations of game and outfile inside loop.