updated the search algorithm and DB