complete nodeEdge function