Simplifying expressions with brackets