combineCoefficients with custom recursion.

I think it is warranted here to improve readability and reduce work.