adding calibration logic