Added some more math stuff and a Pool class.