using _.each
added degree and maxDegree for nodes
added node degree and maxDegree