Update class group computation code to be more awesome