Updated the calibration code