fork of Rhoit's treeprint