these are the function for the minima and maxima values
got the outline of the moment calculator set up