make tree functor