Updated math library to be cleaner and simpler.
Merge remote-tracking branch 'origin/master'