polynomial calculation & calibration handing refactored