re-implemented search functionality