Loop sometimes works but not consistent

You can just edit your existing post as above, to make it readable. NB this isn’t just cosmetic: we need to be able to see if the indentation is correct, which is currently invisible.