added parenthesized subexpression and negation