Updated main to automatically restart from the latest checkpoint file, or if the results file is the last to be modified, start over, taking into account the number of previously recorded results.