anchor.diff:  		end,
   	BaseBcEntities = bc_entities:query_type(base, BcEntities),
   	case lists:map(
  -		   fun(BaseBcEntity) -> 
  -			  BasePlayerNum = bc_entity:player_num(BaseBcEntity),
  -			  {BasePlayerNum, BaseBcEntity}
  -		   end, BaseBcEntities) of
  +		 	fun(BaseBcEntity) -> 
  +				BasePlayerNum = bc_entity:player_num(BaseBcEntity),
  +				{BasePlayerNum, BaseBcEntity}
  +		 	end, BaseBcEntities) of
   		PlayerNumBaseBcEntities when length(PlayerNumBaseBcEntities) > 0 ->
   			EnemyBaseBcEntities =
   				lists:map(
  -				  fun(EnemyNum) ->
  -					  case lists:keyfind(EnemyNum, 1, PlayerNumBaseBcEntities) of
  -						  {BasePlayerNum, BaseBcEntity} ->
  -							  BaseBcEntity;
  -						  false -> 
  -							  undefined
  -					  end 
  -				  end, EnemyNums),
  +					fun(EnemyNum) ->
  +						case lists:keyfind(EnemyNum, 1, PlayerNumBaseBcEntities) of
  +							{BasePlayerNum, BaseBcEntity} ->
  +								BaseBcEntity;
  +							false -> 
  +								undefined
  +						end 
  +					end, EnemyNums),
   			lists:foldl(
  -			  fun(BaseBcEntity, AccBaseBcEntity) -> 
  -				  case AccBaseBcEntity of 
  -					  undefined -> 
  -						  BaseBcEntity;
  -					  AccBaseBcEntity ->
  -						  AccBaseBcEntity
  -				  end 
  -			  end, undefined, EnemyBaseBcEntities);
  +				fun(BaseBcEntity, AccBaseBcEntity) -> 
  +					case AccBaseBcEntity of 
  +						undefined -> 
  +							BaseBcEntity;
  +						AccBaseBcEntity ->
  +							AccBaseBcEntity
  +					end 
  +				end, undefined, EnemyBaseBcEntities);
   		[] ->
   			undefined
   	end.
  
positive.code: 					BaseQueryRes = bc_map:query_ids(BcMap, BaseUuid),
  					BaseBcVertices = 
  						lists:map(
  						  fun(QueryRes) ->
  							maps:get(vertex, QueryRes)
  						  end, BaseQueryRes),
  					UpdatedBaseBcEntity = 
  						bc_entity:set_vertices(BaseBcVertices, BaseBcEntity),
  					InRangeEnemyBcEntityDict = 
  
negative.code: 											map = BcMap} = State) ->
  	Range = bc_entity_config:range(BcEntityConfig),
  	lists:foldl(
  		fun(EnemyBcEntity, AccEnemyBcVertexDict) ->
  			EnemyBcVertices = bc_entity:vertices(EnemyBcEntity),
  			InRangeBcVertices = 
  				bc_map:reaching_neighbors(BcMap, EnemyBcVertices, Range),
  			lists:foldl(
  				fun(InRangeBcVertex, AccAccEnemyBcVertexDict) -> 
  					EnemyBcEntitySet =					
  						case dict:find(InRangeBcVertex, AccAccEnemyBcVertexDict) of
  							{ok, BcEntitySet} ->
  								BcEntitySet;
  							error ->
  								sets:new()
  						end,
  					UpdatedSet = sets:add_element(EnemyBcEntity, EnemyBcEntitySet),
  					dict:store(InRangeBcVertex, UpdatedSet, AccAccEnemyBcVertexDict)
  				end, AccEnemyBcVertexDict, InRangeBcVertices)
  		end, dict:new(), EnemyBcEntities).
  
  in_range_enemies(InRangeEnemyBcEntityDict, BcEntity) ->
  	BcVertices = bc_entity:vertices(BcEntity),
  	lists:foldl(
  		fun(BcVertex, AccEnemyBcEntities) -> 
  			case dict:find(BcVertex, InRangeEnemyBcEntityDict) of 
  				{ok, EnemyBcEntitySet} ->
  					EnemyBcEntities = sets:to_list(EnemyBcEntitySet),
  					lists:append(AccEnemyBcEntities, EnemyBcEntities);
  				error ->
  					AccEnemyBcEntities
  			end
  		end, [], BcVertices).
  
  attack_entities(InRangeEnemyBcEntities, State) ->
  	case lists:filter(
  		 	fun(EnemyBcEntity) ->
  				bc_entity:entity_type(EnemyBcEntity) == base
  			end, InRangeEnemyBcEntities) of
  		InRangeEnemyBaseBcEntity when length(InRangeEnemyBaseBcEntity) > 0 ->
  			EnemyBaseBcEntity = lists:nth(1, InRangeEnemyBaseBcEntity),
  			attack_entity(EnemyBaseBcEntity, State);
  