Made iteration int i in calibration routine static