Solved problem 74 and optimized a function in the Math module.