anchor.diff:              G
       end.
   
  -
  -fit_value(X, List) ->
  -    F = fun({_, Y}) when Y =:= X -> 1;
  -           (_) -> 0
  -        end,
  -    lists:sum(lists:map(F, List)).
  -
   %%% Fitness function stuff
   gen_fit(G) ->
       Res = simulate_run(G),
  -    Avoids = lists:filter(fun ({X, _}) -> X =:= avoid end, Res),
  +    Avoids = [Y || {X, Y} <- Res, X =:= avoid],
       ALen = length(Avoids),
  -    Captures = lists:filter(fun ({X, _}) -> X =:= capture end, Res),
  +    Captures = [Y || {X, Y} <- Res, X =:= capture],
       CLen = length(Captures),
  -    Avs = fit_value(true, Avoids)/ALen * 1/3 * ?NOF_BLOCKS,
  -    Capts = fit_value(true, Captures)/CLen * 2/3 * ?NOF_BLOCKS,
  +    Avs = lists:sum(Avoids)/ALen * ?NOF_BLOCKS,
  +    Capts = lists:sum(Captures)/CLen * ?NOF_BLOCKS,
   %    io:format("~p -- ~p~n", [Avs, Capts]),
  -    math:sqrt(Avs) + Capts.
  +    ?NOF_BLOCKS + Avs - Capts.
   
   
   new_block(Ets) ->
  
positive.code:     case ets:lookup(Ets, block) of
          [#block{size=S, y=0, x=_}] ->
              if S >= ?TRACKER_SIZE ->
                      {avoid, lists:sum(Sensed) =:= 0};
                 S < ?TRACKER_SIZE ->
                      {capture, lists:sum(Sensed) =:= S}
              end
      end.
  
  
negative.code:     ets:insert(Ets, lists:zip(lists:seq(1, ?TRACKER_SIZE),
                                [senses(At, Block) ||
                                    At <- lists:seq(P,P + ?TRACKER_SIZE - 1)])).
  
  actuate(Ets) ->
      [{c, _, #vstate{o = C}}] = ets:lookup(Ets, c),
  