private void prepare()
    {
        int counter = 0;
        for (int u = 0; u < 4; u++) {
            for (int i = 0; i < 5; i++) {
                colorCont = Greenfoot.getRandomNumber(2) + 1;
                sizeCont = Greenfoot.getRandomNumber(2) + 1;
                colorCont2 = Greenfoot.getRandomNumber(2) + 1;

                if (sizeCont == 1){
                    YmarginTop = YtopSmall;
                    YmarginBottom = YbottomLarge;
                    sizeCont2 = 2;
                } else if (sizeCont == 2){
                    YmarginTop = YtopLarge;
                    YmarginBottom = YbottomSmall;
                    sizeCont2 = 1;
                }
                MainContainer x = new MainContainer(sizeCont,colorCont);
                addToList(x,counter);
                addObject(x, Xmargin, YmarginTop);

                if (sizeCont == 1){           
                    MainContainer y =new MainContainer(sizeCont2,colorCont2);
                    addToList(y, counter);
                    addObject(y, Xmargin, YmarginBottom);
                } else if (sizeCont == 2){
                    MainContainer z =new MainContainer(sizeCont2,colorCont2);
                    addToList(z,counter);
                    addObject(z, Xmargin, YmarginBottom);
                }

                Xmargin = Xmargin + 32; 
            }
            counter++;
            Xmargin = 284;

            YtopSmall = YtopSmall + 144;
            YbottomSmall = YbottomSmall + 144;
            YtopLarge = YtopLarge + 144;
            YbottomLarge = YbottomLarge + 144;
        }  
        joinSeperateLists();
    }