dynamic tree...try1