completed implementation of checkpoints (write and load)