implement search method