Feature/math functions

Fixes #5 
Fixes #4