anchor.diff:  			undefined
   	end.	
   
  -on_moved(#state{entity = BcEntity,
  -				entity_config = BcEntityConfig,
  +on_entity_moved(MovedBcEntity, #state{entity = BcEntity, 
  +									  entity_config = BcEntityConfig,
  +									  entities = BcEntities,
  +									  path = PathBcVertices} = State) ->	
  +	UpdatedBcVertices = bc_entity:vertices(MovedBcEntity),
  +	case update_path(UpdatedBcVertices, PathBcVertices) of
  +		undefined ->							
  +			on_moved(State#state{entity = MovedBcEntity,
  +								 path = undefined,
  +								 targets = []});
  +		UpdatedPath ->
  +			on_moved(State#state{entity = MovedBcEntity,
  +								 path = UpdatedPath})
  +	end.
  +
  +on_moved(#state{entity = BcEntity, 
  +				entity_config = BcEntityConfig, 
   				entities = BcEntities} = State) ->
   	EntitiesEventPid = bc_entities:event(BcEntities),
   	gen_event:notify(EntitiesEventPid, {entity_moved, BcEntity}),
  
positive.code: 				ok ->
  					MovedBcEntity = bc_entity:set_vertices(UpdatedBcVertices, BcEntity),
  					ReorientedBcEntity = reorient_entity(Direction, MovedBcEntity, BcEntities),
  					case update_path(UpdatedBcVertices, Path) of
  						undefined ->							
  							on_moved(State#state{entity = ReorientedBcEntity,
  												 path = undefined,
  												 targets = []});
  						UpdatedPath ->
  							on_moved(State#state{entity = ReorientedBcEntity,
  												 path = UpdatedPath})
  					end;
  				{error, _} ->
  					stand(State)
  			end;
  		false ->
  			stand(State)
  	end.
  
  stand(State) ->
  
negative.code: 		true ->			
  			MoveBcVertex = lists:nth(1, PathBcVertices),
  			Direction = bc_entity_util:move_direction(BcEntity, MoveBcVertex),
  			case move(Direction, State) of
  				{ok, MovedBcEntity} ->
  					on_entity_moved(MovedBcEntity, State);
  				{error, _} ->
  					sense(State#state{path = undefined,
  									  targets = []});
  				_ ->
  					sense(State#state{path = undefined,
  									  targets = []})
  			end;
  		false ->
  			sense(State#state{path = undefined,
  							  targets = []})
  	end.
  
  choose_path(InRangeBcVertices, NearbyBcEntities, 
  			#state{entity = BcEntity, map = BcMap} = State) ->
  	SortedDistBcVertices = sorted_dist_vertices(InRangeBcVertices, State),
  