Checkpoint

rearrange code