Fixed up math library. Still 3 functions TODO.