I’m working on a computer algebra system to “”“cheat”“” my way through high school, but I can’t seem to figure out this polynomial addition block I’m working on:

It’s supposed to say “(5x^1)+(2y^1)”, but it’s somehow repeating the first term entered?? I’m stumped, I don’t know what’s wrong with my code here.
Edit: Whoops, mixed up some variables (id of a in add polynomials should have been id of b). That was embarrasing…
Classic way of debugging :-) 
When you can’t see the problem - ask for help - the act of asking lets you see the problem and fix it 
Do you mean asking someone one knows in real life? Because if you mean asking for help in general, that is what OP did here.
I was gonna try and help but i didnt know how go access the block so i checked your page and came accross a forum you were in about you asking the same thing . Well now i know