Comments and better RE

Added comments to (hopefully) explain how sorry I am that I went about
doing things this way, and that I'm hoping there's assumedly a correct way
to do this in Python, which probably isn't implementing reduce_while().
Unlikely anyone will see this, but if I'm that angsty about my Moodler
submission, I'll link Mr. Wu to this.