Checkpoint; may be able to simplify a lot