modify the python script to fit new structure of node.