Flexible Layout and Query Loop

Loop Index #2: