Documentation and calibration changes

Adds commenting on the functions and returns calibration value.