make math funcs more flexible