sorting of matches