more tree algorithms