implementing the searching