exported tree2 function into dan.helper.vine