Update the  tree search code