function blok2(a,i,j);

global dom;


if a>1

    r=a/2;
    blok2(r,i,j);
    blok2(r,i+r,j);
    blok2(r,i,j+r);
    blok2(r,i+r,j+r);
end;
if a==1
    if dom

        global M;
        global c;
        global znk;
        global matr;
        global prag;
        global iter;
        if abs(M(j,i))>=prag

            matr(j,i)=sign(M(j,i));
            c=c+1;
            if sign(M(j,i))==1
                znk(c)='p';
                M(j,i)=0;
            else
                znk(c)='n';
                M(j,i)=0;
            end
        end
        uvjet=1;
        if and(i==2, j==2)
            1;
        end
        if abs(M(j,i))<=prag

            if matr(j,i)==0

                t=tree(i,j);
                for i2=1:128
                    for j2=1:128
                        if t(j2,i2)=='x'
                            if abs(M(j2,i2))>=prag
                                uvjet=0;
                            end
                        end
                    end
                end
                if i+j==2
                    uvjet=0;
                end
                if uvjet
                    matr=matr+t;
                    c=c+1;
                    znk(c)='t';
                else
                    matr(j,i)='x';
                    c=c+1;
                    znk(c)='z';
                end
            end
        end
    end
    if dom==0

        global M;
        global c;
        global znk;
        global matr;
        global prag;
        global iter;
        global D;
        global pom;
        global s;
        global rek;
        global M2;
        global I;
        
            
        if abs(rek(j,i,I))>0
            
            if abs(M2(j,i))>abs(pom(j,i))
                rek(j,i,I)=rek(j,i,I)+sign(rek(j,i,I))*D;
                c=c+1;
                s(c)=1;
            else
                c=c+1;
                s(c)=0;
            end
        end
    end
end







