Ah yes, what was I thinking?!?
I changed it to a while loop and it works better now.
Yet some other challenges