Generalized basic search and cleaned out some details.