completed sort by index