edited search algorithm
update