%     update boundaries for fish4.m
      fish(1,:)=fish(d+1,:);
      fish(d+2,:)=fish(2,:);
      fish(:,1)=fish(:,d+1);
      fish(:,d+2)=fish(:,2);
      direction(1,:)=direction(d+1,:);
      direction(d+2,:)=direction(2,:);
      direction(:,1)=direction(:,d+1);
      direction(:,d+2)=direction(:,2);
