refactored math functions into it's own class