added a checkpoint functionality. fixes #174