Added a few math helper functions