implemented search functionality