restore saving and loading, checkpoints, testing