implements search method