inDegrees and getDegrees implemented and tested