outlined main search method