added some math functions.
updated.