sort people by group