added code for layerOfNodes and hyperGraph