fixing parse_math_expression()