tightening math lib., fixed up a few things in fmt_text