anchor.diff:         true ->
               NewPos = RawPos
       end,
  +%    io:format("Old position: ~p, new position: ~p~n", [OldPos, NewPos]),
       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 ->
  +edge_from(X) when X =:= a orelse X =:= b ->
  +    [a, b] ++ lists:seq(1, ?TRACKER_SIZE);
  +edge_from(X) when X =:= c orelse X =:= d ->
       [a, b, c, d].
   
   get_output(Ets, X) when is_atom(X) ->
  
positive.code: 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).
  
  simulate_run(G) ->
      io:format("whole:~n~p~n~n", [G]),
      Ets = ets:new(x, [set]),
      Firsts = lists:zip([#edge{from=F, to=T} || T <- [a, b],
                                                 F <- [1, 2, 3, 4, 5, a, b]],
                         lists:sublist(G, 2*7)),
      ets:insert(Ets, Firsts),
      io:format("first 14:~n~p~n~n", [Firsts]),
      OtherEdges = lists:zip([#edge{from=F, to=T} || T <- [c, d],
                                                     F <- [a, b, c, d]],
                             lists:sublist(G, 2*7 + 1, 2*4)),
      io:format("next 8:~n~p~n~n", [OtherEdges]),
      ets:insert(Ets, OtherEdges),
      Vertices = lists:sublist(G, 2*7 + 2*4 + 1, 4),
      io:format("and finally, vertices:~n~p~n~n", [Vertices]),
      ets:insert(Ets, [{Name, Vertex, #vstate{}} ||
                          Vertex = #vertex{name=Name} <- Vertices]),
      ets:insert(Ets, {tpos, 0}),
      ets:insert(Ets, {blocks_left, 39}),
      new_block(Ets),
      ets:insert(Ets, #block{size=6, x=27, y=15}),
      sense(Ets),
      Hmm = cognitive_step(Ets),
      All = ets:match_object(Ets, '_'),
      ets:delete(Ets),
      io:format("~P~n~n~P~n", [All, 100, Hmm, 100]).
  
  
  
  
negative.code:                                   At <- lists:seq(P,P + ?TRACKER_SIZE - 1)])).
  
  %% Speed generated by a motor neuron
  speed(X) when 0.2 =< X, X < 0.5 -> 1;
  speed(X) when 0.5 =< X, X < 0.9 -> 2;
  speed(X) when 0.9 =< X, X < 0.95 -> 3;
  speed(X) when 0.95 =< X -> 4;
  speed(_) -> 0.
  
  