Seperated out custom calculus functions