major rework; add calibration routine