Moved math functions to separate directory