Moving output mehtod to Tree.