Iterator and sort