function G = grow(V)

  G = V;
  
  for i = 2 : length(V)-1
    if (V(i) != 0)
      if (V(i+1) == 0)
        G(i+1) = V(i);
      elseif (V(i-1) == 0)
        G(i-1) = V(i);
      endif
    endif
  endfor

endfunction
