Added in & out degree calculation