add basesearch function, update search, replace