use a for loop where i should have