Implemented search function.