Iterate through an sorted list