Included some code for the checkpoint even though it doesn't work as good as planned