Code for Calibration