added math functions, based on the binary list function. added tests for math functions