Use iterator on both arguments in sortBy