libz calibration stuff