Basic functionality for converting the tree