anchor.diff:  						  entity_config = BcEntityConfig, 
   						  map = BcMap} = State) ->
   	Range = bc_entity_config:range(BcEntityConfig),
  -	EnemyInRangeVertices = lists:flatten(
  +	EnemyInRangeVertices = 
   		lists:map(
   			fun(EnemyBcEntity) -> 
   				EnemyBcVertices = bc_entity:vertices(EnemyBcEntity),
   				InRangeBcVertices = 
   					bc_map:reaching_neighbors(BcMap, EnemyBcVertices, Range),
   				{EnemyBcEntity, InRangeBcVertices} 
  -			end, EnemyBcEntities)
  -	),
  +			end, EnemyBcEntities),
   	case in_range_enemies(EnemyInRangeVertices, BcEntity) of
   		InRangeEnemyBcEntities when length(InRangeEnemyBcEntities) > 0 ->
   			attack_entities(InRangeEnemyBcEntities, State);
  
positive.code: 	Direction = bc_entity_util:move_direction(BcEntity, MoveBcVertex),
  	move(Direction, State).
  	
  choose_path(DistBcVertices, DistEntities, #state{entity = BcEntity,
  												 map = BcMap} = State) ->
  	EntitiesBcVertices = 
  		lists:flatten(
  			lists:map(fun({_, NearbyBcEntity}) -> 
  						bc_entity:vertices(NearbyBcEntity) 
  					  end, DistEntities)
  		),
  	SortedDistBcVertices = 
  		lists:sort(fun({Dist1, _}, 
  					   {Dist2, _}) -> 
  						Dist1 =< Dist2 
  				   end, DistBcVertices),
  	case lists:filter(fun({_, BcVertex}) ->
  						not lists:member(BcVertex, EntitiesBcVertices)
  					  end, SortedDistBcVertices) of
  		UnoccupiedSortedDistBcVertices 
  		  when length(UnoccupiedSortedDistBcVertices) > 0 ->			
  
negative.code: 			  #state{entity = BcEntity, map = BcMap} = State) ->
  	%% TODO reimplment with nearbybcentities.
  	DistBcVertices = 
  		lists:map(
  			fun(BcVertex) -> 
  				Distance =
  					bc_entity_util:vertex_distance(BcEntity, BcVertex),
  				{Distance, BcVertex} 
  			end, InRangeBcVertices),
  	OccupiedBcVertices =
  		lists:flatmap(
  			fun(NearbyBcEntity) -> 
  				bc_entity:vertices(NearbyBcEntity) 
  			end, NearbyBcEntities),
  	case choose_path(DistBcVertices, OccupiedBcVertices, State) of
  		PathBcVertices when is_list(PathBcVertices) andalso 
  								length(PathBcVertices) > 0 ->
  			move_on_path(State#state{path = PathBcVertices});
  