Feature/checkpoint

Adds the ability to checkpoint in the thread