implemented a checkpoint system