took out first getitem and put it inside loop