Model Calc functions

Refactored the calc functions at the beginning of the module to accept
the new data classes.