Updating logic to accomodate additional option groups.