updated MathUtil with some more utilities