debugging in loops