Identify and group like terms (#261)

Identify and group like terms (#261)

Group terms with the same variable and exponent.