remove misplaced 2nd for loop