added calibration function