Added code needed for calibration