add calibration code