some functions moved to util
Calculus functions