fixed bug with surds in denominator