added magic calibration