Work on progress on calibration function