implemented outdegree