checkpointing work on problem 3