function rowList=rowListing(k,m)
tm1=0.5*m*(m-1);
rowList=zeros(1,k*m^2);

% off diagonal first
counter=0;
for ii=1:tm1,
    temp=[ii:m^2:k*m^2; (tm1+ii):m^2:k*m^2];
    rowList(counter+1:counter+2*k)=temp(:);
    counter=counter+2*k;
end

% then the diagonal
for ii=1:m,
    rowList(counter+1:counter+k)=(m*(m-1)+ii):m^2:k*m^2;
    counter=counter+k;
end
