added code to parse formula with parenthesises.