refactor of math functions and objects

not yet finished