added some code for layerOfNodes and hyperGraph