Add faster degree calculation