slight change to search algo