modularized calibration code successfully