Routine within sequential loop appearing in random places

Please explain your design to us and how this is reflected in the screenshot. For example, it is not clear why you have multiple nested loops.

EDIT: from this post below, it seems that you have larger issues. Would suggest that you just delete this topic and focus on the suggestions you get in the other one: