function outnew=stepping_stone(A0,m,n,steps)


outold=A0;
oddf=figure;
hold on;
colormap(jet);
figure(oddf);
clf;
imagesc(A0);
colorbar
pause(.5)
for z=1:steps
    outnew=zeros(m,n);

for i=1:m
    for j=1:n
        r=randi([1,8]);
        if r==1
        outnew(i,j)=outold(mod(i,m)+1,j);
        end
        if r==2
                    outnew(i,j)=outold(mod(i-2,m)+1,mod(j-2,n)+1);
        end
        if r==3
                    outnew(i,j)=outold(mod(i-2,m)+1,j);
        end
        if r==4
                    outnew(i,j)=outold(i,mod(j,n)+1);
        end
        if r==5
                    outnew(i,j)=outold(mod(i,m)+1,mod(j-2,n)+1);
        end
        if r==6
                    outnew(i,j)=outold(mod(i,m)+1,mod(j,n)+1);
        end
        if r==7
                    outnew(i,j)=outold(mod(i,m)+1,mod(j-2,n)+1);
        end
        if r==8
                    outnew(i,j)=outold(mod(i-2,m)+1,mod(j,n)+1);
        end
    end
end
figure(oddf);
clf;
imagesc(outnew);
colorbar;
pause(.5)
outold=outnew;
end
        




