refactor getHighestDegree(), int count removed