private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            DuelList Dlist = DuelMaker.duelDispose(DuelMaker.createDuels(Selist));
            int      step  = 70;

            for (int i = 0; i < Dlist.getSize(); i++)
            {
                WrapPanel p1 = Duel_Create(step * i, 0, 1, Dlist.getDuel(i));
                grid.Children.Add(p1);
                grid.Children.Add(Fork_Create(step * i + 15, 36 * 6, 30));
            }


            int top = 15;

            for (int s = steps; s > 0; s--)
            {
                int left = (36 * 6 + 40) * (steps - s + 1);
                int k    = (int)Math.Pow(2, s - 1);

                for (int n = 0; n < k; n++)
                {
                    grid.Children.Add(AlonePanel_Create(top + 70 * (int)Math.Pow(2, steps - s) * n, left, n, ""));
                }

                for (int n = 0; n < k / 2; n++)
                {
                    grid.Children.Add(Fork_Create((top + 15) + 70 * (int)Math.Pow(2, steps - s + 1) * n, left + 36 * 6, 70 * (int)Math.Pow(2, steps - s)));
                }

                top += 35 * (int)Math.Pow(2, steps - s);
            }
        }
        public static DuelList duelDispose(DuelList dlist)
        {
            int      counter = dlist.getSize();
            DuelList sort    = new DuelList(counter);

            for (int i = 0; i < counter - 1; i += 2)
            {
                sort.setDuel(dlist.getDuel(i), i);
                sort.setDuel(dlist.getDuel(counter - (i + 1)), i + 1);
            }
            return(sort);
        }
 public static DuelList createDuels(CompetitorsList compList, int dNum = 0)   //create new duel list
 {
     if (dNum >= 0)
     {
         int      compNum = compList.getSize();
         DuelList myList  = new DuelList(compNum / 2);
         for (int i = 0; i < myList.getSize(); i++)
         {
             Duel newDuel = new Duel(compList.getCompetitor(i), compList.getCompetitor(compNum - (i + 1)), dNum);
             myList.setDuel(newDuel, dNum);
             dNum++;
         }
         return(myList);
     }
     else
     {
         throw new ArgumentException("Parameter cannot be smaller then zero", "dNum");
     }
 }