Added in Sorting of indices in a CW fashion