Adding polynomials with multiple terms and variables