Simplifying an expression with multiple variables