Loop over the correct array