Database would be the best alternative, but could be complex to implement at this stage of your effort. You said you are writing to a text file. Perhaps you could write multiple text files (one for each attempt): FinalExamResults1.txt, FinalExamResults2.txt, and so on. You would have to write code to check for the multiple iterations, but it shouldn't be too difficult. I can assist with that as well, if necessary . . .