closed first for loop