Added calibration routine