sort implemented in duplicate find