added encoding to node.py