code cleanup (mathFunctions)