first draft version of the quicksearch function