Implement searching function.