Controller now attempts to build a tree, not fully tested