Testing added calibration code
Some library cleanup