add new function countAllDegree()