anchor.diff:  
   code_change(_OldVersion, State, _Extra) ->
   	{reply, State}.
  +
  +%% --------------------------------------------------------------------------------------------------------------------
  +%% Internal API
  +%% --------------------------------------------------------------------------------------------------------------------
  +
  +simulate_entities([], _State) ->
  +	ok;
  +
  +simulate_entities([{EntityID, Entity} | Rest], State) ->
  +	% Simulate this entity's behavior.
  +	Behavior = Entity#entity.behavior,
  +	NewEntity = apply(Behavior, simulate, [{Entity, State}]),
  +	dict:store(EntityID, NewEntity, State#state.entities),
  +	simulate_entities(Rest, State).
  +
  +
  +send_to_watchers([], _EntityID, _State) ->
  +	ok;
  +
  +send_to_watchers([Watcher | Rest], EntityID, State) ->
  +	% Send `{update, EntityID, State}` to Watcher
  +	Watcher ! {update, EntityID, State},
  +	send_to_watchers(Rest, EntityID, State).
  +
  +%% --------------------------------------------------------------------------------------------------------------------
  
positive.code: %%% @doc The entity simulation engine.
  
  -module(pre_entity_engine).
  -behavior(gen_server).
  
  -include("log.hrl").
  -include("pre_entity.hrl").
  
  % API
  -export([start_link/1]).
  -export([add_entity/1, remove_entity/1, update_entity_state/3]).
  
  % gen_server
  -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
  
  -record(state, {
  	entities :: dict()
  
negative.code: 	State = #state{
  		entities = dict:new()
  	},
  
  	% Start the simulation timer
  	erlang:send_after(?INTERVAL, self(), simulate),
  
  	{ok, State}.
  
  %% --------------------------------------------------------------------------------------------------------------------
  
  handle_call({add, Entity}, _From, State) ->
  	Entities = State#state.entities,
  	NewState = State#state {
  		entities = dict:append(Entity#entity.id, Entity, Entities)
  	},
      {reply, ok, NewState};
  
  handle_call({remove, EntityID}, _From, State) ->
  	Entities = State#state.entities,
  	NewState = State#state {
  		entities = dict:erase(EntityID, Entities)
  	},
      {reply, ok, NewState};
  