function [Q R] = BlockHess2 (A, r)
% Block Hessenberg Reduction
% p - number of blocks
% r - number of extra diagonals
% pr x r block structure
    for j=1:r
        if j>1
            A(:,j)=A(:,j)+Y*v(j,:)';
            A(:,j)=A(:,j)+W*T'*W'*A(:,j);
        end
        v=house(A(:,j));
        A(:, j) = eye(size(v))-2*v*v'*A(:, j);
        if j==1
            W=-2*v;
            Y=v;
        else
            z=-2*(eye(size(W*Y'))+W*Y')*v
            W=[W z];
            Y=[Y v];
        end
        T=compactWY(Y, 2);
    end
R=A;
end