Added search functionality and tests