Added the ability to resume from checkpoints. Also refactored the code to not use arrays, thereby using MUCH less memory.