added search and sorting.