Introduce node_location to replace the long list of parameters. Also add a depth field to keep track of the depth from root.