How to build a tree