improved the search algorithm and responses