Simplifying expressions with parentheses