}// GetPolicyLevelFromLabel

        internal static int ListifyCodeGroup(Object cgBase, Object cgStop, out SuperCodeGroupArrayList scalFinal)
        {
            scalFinal = new SuperCodeGroupArrayList();
            SuperCodeGroupArrayList scalTemp = new SuperCodeGroupArrayList();

            if (cgBase == null)
            {
                return(-1);
            }

            scalTemp.Add(new SuperCodeGroup(-1, cgBase, 0));

            while (scalTemp.Count > 0)
            {
                // Put this guy in the final one....
                int nMyIndex = scalFinal.Add(scalTemp[0]);
                // If this guy is the main codegroup we're interested in, let's stop now
                if (cgStop != null && scalTemp[0].Equals(cgStop))
                {
                    return(nMyIndex);
                }

                // Iterate through this guy's children
                for (int i = 0; i < scalTemp[0].NumChildren; i++)
                {
                    Object cg = scalTemp[0].GetChild(i);
                    scalTemp.Add(new SuperCodeGroup(nMyIndex, cg, i));
                }
                // Now remove this guy from the list
                scalTemp.RemoveAt(0);
            }

            return(-1);
        }// ListifyCodeGroup
        }// FindAGoodCodeGroupName

        private static bool DoesThisCodegroupExist(SuperCodeGroupArrayList al, String s, CodeGroup cgExclude)
        {
            if (al == null || s == null || s.Length == 0)
            {
                return(false);
            }

            for (int i = 0; i < al.Count; i++)
            {
                if (!al[i].Equals(cgExclude) && al[i].cg.Name != null && al[i].cg.Name.Equals(s))
                {
                    return(true);
                }
            }
            return(false);
        }// DoesThisCodegroupExist
        }// ListifyCodeGroup

        internal static int ListifyPolicyLevel(PolicyLevel pl, Object cgStop, out SuperCodeGroupArrayList al)
        {
            return(ListifyCodeGroup(GetRootCodeGroupNode(pl), cgStop, out al));
        }// ListifyPolicyLevel