Big messy commit, includes calibration