work on leaf ordering when sampling trees
input output functions
First sampler working