Crude, but working, version of the node-definition logic (tree definition)