Added more functionality to math library