Adding a first version of the tree mode