moved message printout to top of searchSample