Added a function to add a special root node. Changed the script to perform no modification of the data on its own - now all transformation happens at the C++ code.