Add functions to get indegree and outdegree of a node