implementation of search