function y = mg_step(r,AA,PP)

m = length(AA);

rr = cell(1,m);

rr(end) = r;

for k=m:-1:2
    vv{k} = gs_inc(AA{k}, rr{k});

    rr{k} = rr{k} - AA{k}*vv{k};
    
    rr{k-1} = PP{k-1}'*rr{k};
end

vv{1} = gs_inc(AA{1}, rr{1});
%rr{1} = rr{1} - AA{1}*vv{1};

for k = 2:m
    vCoarse = PP{k-1}*vv{k-1};
    vv{k} = vv{k} + vCoarse;
end
y = vv{m};

