adding manual control, finishing calibration code