implemented first version of search