can iterate through the array with indices