math now works, needs a bit of cleanup though.