I think it would be more clear if you just create `xieq` and `etaeq` from the loop over `power in range(i + 1)`, rather than pulling terms out of termslist.