Factoring by grouping with multiple variables