faster sorting of matches