coreG function

Find core (primary) group