extract function

Group-based Subset