It looks like this is an experiment in the complications of nested loops. I would suggest taking out the prints that are there and adding new prints that tell you what loop you are in and the values...