%
%decide whether to move north, move, mark as having moved, and update boundaries
  move( 2:d+2, 2:d+1 ) = fish( 2:d+2, 2:d+1 ) & ...
        ( direction( 2:d+2, 2:d+1 ) == 2) & ( ~fish( 1:d+1, 2:d+1 ) );
  fish(2:d+1,2:d+1)= ( fish(2:d+1,2:d+1) & (~move(2:d+1,2:d+1) ) ) | ...
                     move(3:d+2,2:d+1);
  direction(2:d+1,2:d+1) = direction(2:d+1,2:d+1) .* ( 1-move(3:d+2,2:d+1));
  updateboundaries;
  if dbug == 1, 
     subplot(222), plotfish; 
     disp(['i= ',num2str(i),' just moved north']), keyboard, 
  end
