bug when root has maximum degree