added some math functions