Another attempted fix at the sorting iterator