moved loop placement