Sorting matches by x coordinate

Also erases dupIndices