Feature/math functions

Fixes #5