implementing search method