added checkpoint functionality (is optional)