Modified calibration code