In horrible nested loop part