Added SetSortOrder function