added sorting of results