creating functions

functions for the calculations