anchor.diff:                  A - ?AREA_WIDTH == At_m;
              (A) -> A == At_m
           end,
  -    lists:any(Cmp, lists:seq(X, X + S - 1)). %% - 1 to avoid blocksize+1
  +    case lists:any(Cmp, lists:seq(X, X + S - 1)) of %% - 1 to avoid blocksize+1
  +        true -> 1;
  +        false -> 0
  +    end.
   
   sense(Ets) ->
       [Block] = ets:lookup(Ets, block),
       [{tpos, P}] = ets:lookup(Ets, tpos),
  -    ets:insert(Ets, {sensed, [senses(At, Block) ||
  -                                 At <- lists:seq(P,P + ?TRACKER_SIZE - 1)]}).
  +    ets:insert(Ets, lists:zip(lists:seq(1, ?TRACKER_SIZE),
  +                              [senses(At, Block) ||
  +                                  At <- lists:seq(P,P + ?TRACKER_SIZE - 1)])).
   
   %% Speed generated by a motor neuron
   speed(X) when 0.5 =< X, X < 0.9 -> 1;
  
positive.code:     new_block(Ets),
      ets:insert(Ets, #block{size=6, x=27, y=15}),
      sense(Ets),
      All = ets:match_object(Ets, '_'),
      ets:delete(Ets),
      io:format("~P~n", [All, 100]).
  
  
  
  
negative.code:     end,
      ets:insert(Ets, {tpos, NewPos}).
  
  edge_from(X) when X == a orelse X == b ->
      lists:seq(1, ?TRACKER_SIZE) ++ [a, b];
  edge_from(X) when X == c orelse X == d ->
      [a, b, c, d].
  
  get_output(Ets, X) when is_atom(X) ->
      [{X, _, #vstate{o = O}}] = ets:lookup(Ets, X),
      O;
  get_output(Ets, X) when is_integer(X) ->
      [{X, O}] = ets:lookup(Ets, X),
      O.
  
  new_vstate(Ets, X) ->
      Edges = [Edge || F <- edge_from(X),
                       Edge <- ets:lookup(Ets, #edge{to=X, from=F})],
      %% ^ one level flatten
      Sum = lists:sum([case Edge of
                       {#edge{to=X, from=F}, W} ->
                           get_output(Ets, F) * W
                       end || Edge <- Edges]),
      [{X, #vertex{tau=Tau, sigma=Sigma, gain=G, name=X} = V,
           #vstate{o=_OldO, y=OldY}}]
          = ets:lookup(Ets, X),
      DY = (Sum + Sigma - OldY)/Tau,
      Y = OldY + DY,
      O = 1 / (1 + math:exp(-G * Y)),
      {X, V, #vstate{o=O, y=Y}}.
  
  cognitive_step(Ets) ->
      [new_vstate(Ets, Name) || Name <- [a, b, c, d]].
  
  move_block(_Ets) ->
      nil.
  
  step(Ets) ->
      sense(Ets),
      VertexStates = cognitive_step(Ets),
      actuate(Ets),
      move_block(Ets).
  
  