%     update boundaries 
      fish(1,:)=fish(d+1,:);
      fish(d+2,:)=fish(2,:);
      fish(:,1)=fish(:,d+1);
      fish(:,d+2)=fish(:,2);
      shark(1,:)=shark(d+1,:);
      shark(d+2,:)=shark(2,:);
      shark(:,1)=shark(:,d+1);
      shark(:,d+2)=shark(:,2);
      fishage(1,:)=fishage(d+1,:);
      fishage(d+2,:)=fishage(2,:);
      fishage(:,1)=fishage(:,d+1);
      fishage(:,d+2)=fishage(:,2);
      sharkage(1,:)=sharkage(d+1,:);
      sharkage(d+2,:)=sharkage(2,:);
      sharkage(:,1)=sharkage(:,d+1);
      sharkage(:,d+2)=sharkage(:,2);
      sharkeat(1,:)=sharkeat(d+1,:);
      sharkeat(d+2,:)=sharkeat(2,:);
      sharkeat(:,1)=sharkeat(:,d+1);
      sharkeat(:,d+2)=sharkeat(:,2);
      sharkdir(1,:)=sharkdir(d+1,:);
      sharkdir(d+2,:)=sharkdir(2,:);
      sharkdir(:,1)=sharkdir(:,d+1);
      sharkdir(:,d+2)=sharkdir(:,2);
      fishdir(1,:)=fishdir(d+1,:);
      fishdir(d+2,:)=fishdir(2,:);
      fishdir(:,1)=fishdir(:,d+1);
      fishdir(:,d+2)=fishdir(:,2);
