Added custom search functionality and sorting options