//Constructor helper: checks for empty fusion sites and matches them to neighboring defined Sites, if any
        private void matchSites(StackPanel pan)
        {
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(pan); i++)
            {
                UIElement elem = (UIElement)VisualTreeHelper.GetChild(pan, i);

                //If element is Sites and empty, find its neighbor and copy data from it
                if (elem.GetType() == typeof(Sites) && ((Sites)elem).Sequence == "site")
                {
                    int sourceIndex = Sites.neighborSiteIndex(i, pan);

                    //to catch when for some reason the copySource is a Part instead of a Sites object
                    object indexedElement = VisualTreeHelper.GetChild(pan, sourceIndex);
                    if (indexedElement is Sites)
                    {
                        Sites copySource = (Sites)indexedElement;
                        ((Sites)elem).copySitesInfoFrom(copySource);
                    }
                }
            }
        }