calibrate function added