rewrite  createNodes.py