Working linux version with calibration