Added degree() functionality