Automatic Checkpointing
added checkpointing