moved math functions to math.hpp