added sorting and filtering for search results