math fixes - errors, formulas better picking up surrounding style.