Modified functions to take into account undefined s_groups