fixed bug in degree.py