group specialities by degree