Added a bunch of math functions.
TODO: Cleanup the functions and write Unit Tests.