implemented checkpointing, needs refinements for passable arguments, but bulk is there and it works