proper sorting of results from long search