Moved destructuring of SortIndex in the for