Implement search function.