Adjustments to tree algorithm