broke out all of the search sub functions.