ability to write tree to file