moved the tree layout outside