anchor.diff:  move(A, E, Config) ->
       %% based on agent state and its neighbourhood
       %% compute the new agent state and neighbourhood
  -    %% langton's ant
  -    {Old, New} = get_move(A, E, Config),
  -    #ant{pos = OPos, state = {ODir, OCell}} = Old,
  -    #ant{pos = NPos, state = {NDir, _}} = New,
  -    case {ODir, ants_impl:get_agent(New#ant.pos, E, Config)} of
  -        {empty, _} ->
  -            E;
  -        {_, {empty, CellState}} ->
  -            E1 = ants_impl:update_agent(NPos, {NDir, CellState}, E, Config),
  -            OldState = {empty, update_cell(OCell)},
  -            ants_impl:update_agent(OPos, OldState, E1, Config);
  -        {_, _} ->
  -            E
  -    end.
  +    %% algae dispersion
  +    #env{world = #world{w = W, h = H}} = E,
  +    Pos = A#ant.pos,
  +    UpdateNeighbour =
  +        fun(NPos, Env) ->
  +                {Level} = ants_impl:get_agent(NPos, Env, Config),
  +                ants_impl:update_agent(NPos, {Level + 1}, Env, Config)
  +        end,
  +
  +    State = ants_impl:get_agent(Pos, E, Config),
  +    NewEnv = case State of
  +                 {Level} when Level > 4 ->
  +                     Ns = neighbours_4(Pos, W, H),
  +                     E1 = lists:foldl(UpdateNeighbour, E, Ns),
  +                     ants_impl:update_agent(Pos,
  +                                            {Level - length(Ns)},
  +                                            E1,
  +                                            Config);
  +                 {Level} when Level =< 0 orelse Level >= 10 ->
  +                     E;
  +                 {Level} ->
  +                     ants_impl:update_agent(Pos, {Level+1}, E, Config)
  +             end,
  +    NewEnv.
   
   -spec get_move(ant(), environment(), config()) -> {ant(), ant()}.
   get_move(A, E, Config) ->
  
positive.code: initial_population(PopulationSize, Width, Height, Config) ->
      AllPositions = [{I, J} || I <- lists:seq(1, Width),
                                J <- lists:seq(1, Height)],
      AntPositions = lists:sublist(shuffle(AllPositions), 1, PopulationSize),
      CellPositions = AllPositions,
      All = [{Pos, [ant]} || Pos <- AntPositions]
          ++ [{Pos, [cell]} || Pos <- CellPositions],
      [populate_cell(Pos, Members, Config)
       || {Pos, Members} <- ants:group_by(All)].
  
  populate_cell(Pos, Members, Config) ->
      AntState = case lists:member(ant, Members) of
                  true ->
                      model:random_ant_state(Config);
                  _ ->
                      empty
              end,
      {Pos, {AntState, model:initial_cell_state(Config)}}.
  
  -spec shuffle(list()) -> list().
  shuffle(L) ->
  
negative.code:     NewX = torus_bounds(X + DX, W),
      NewY = torus_bounds(Y + DY, H),
      {NewX, NewY}.
  
  neighbours_4({X,Y}, W, H) ->
      [{torus_bounds(X+1, W), Y},
       {torus_bounds(X-1, W), Y},
       {X, torus_bounds(Y+1, H)},
       {X, torus_bounds(Y-1, H)}].
  
  
  torus_bounds(Val, Max) when Val < 1 -> Max + Val;
  torus_bounds(Val, Max) when Val > Max -> Val - Max;
  