Added searching and sorting functionality