Hi dstar5 obviously there is a bug in your algorithm (a programmer's error maybe).
you are trying to solve it using prints.
Suggestion:
if your using any IDE, well, I think using its debug mode...