added parameters, tweaked checkpointing