basic math functions implemented