Moved functions to subdir math/