adds checkpointing