function [L,R] = warmup (N,L,R,S,rhoA,rhoB,extraA,extraB)

global slimit;

for j = 2:N/2-1
    
    disp (['Warmup J = ', num2str(j)]);
    
    if rhoA == -1
        ntotalA = -1;
    else
        ntotalA = round(2*j*rhoA+extraA);
    end;
    
    if rhoB == -1
        ntotalB = -1;
    else
        ntotalB = round(2*j*rhoB+extraB);
    end;
    
    G = superblock (L(j-1),S(j),S(N-j+1),R(j-1),ntotalA,ntotalB);
    L(j) = getleft (L(j-1),S(j),S(N-j+1),R(j-1),G);
    R(j) = getright (L(j-1),S(j),S(N-j+1),R(j-1),G);
        
    E0 = Inf;
    DE = 1;
    while abs(DE) > slimit
        [L,R] = sweep (2*j,L,R,S,ntotalA,ntotalB);
        E = meas (2*j,L,R,S,ntotalA,ntotalB);
        DE = E - E0;
        E0 = E;
        disp (['DE = ' num2str(DE)]);
    end

end
