added full calibration functionality and proper scaling