anchor.diff:  handle_event(Event, StateName, StateData) ->
     {next_state, StateName, StateData}.
   
  +-spec handle_sync_event(Event :: term(), From :: {pid(), Tag :: term()}, StateName :: atom(), StateData :: term()) -> Result when
  +	Result :: {reply, Reply, NextStateName, NewStateData}
  +			| {reply, Reply, NextStateName, NewStateData, Timeout}
  +			| {reply, Reply, NextStateName, NewStateData, hibernate}
  +			| {next_state, NextStateName, NewStateData}
  +			| {next_state, NextStateName, NewStateData, Timeout}
  +			| {next_state, NextStateName, NewStateData, hibernate}
  +			| {stop, Reason, Reply, NewStateData}
  +			| {stop, Reason, NewStateData},
  +	Reply :: term(),
  +	NextStateName :: atom(),
  +	NewStateData :: term(),
  +	Timeout :: non_neg_integer() | infinity,
  +	Reason :: term().
   handle_sync_event(Event, From, StateName, StateData) ->
  -    Reply = ok,
  -    {reply, Reply, StateName, StateData}.
  +    {reply, ok, StateName, StateData}.
   
   %% ====================================================================
   %% Gen_* functions
   %% ====================================================================
   
  +-spec handle_info(Info :: term(), StateName :: atom(), StateData :: term()) -> Result when
  +	Result :: {next_state, NextStateName, NewStateData}
  +			| {next_state, NextStateName, NewStateData, Timeout}
  +			| {next_state, NextStateName, NewStateData, hibernate}
  +			| {stop, Reason, NewStateData},
  +	NextStateName :: atom(),
  +	NewStateData :: term(),
  +	Timeout :: non_neg_integer() | infinity,
  +	Reason :: normal | term().
   handle_info(Info, StateName, StateData) ->
       {next_state, StateName, StateData}.
   
  +-spec terminate(Reason, StateName :: atom(), StateData :: term()) -> Result :: term() when
  +	Reason :: normal
  +			| shutdown
  +			| {shutdown, term()}
  +			| term().
   terminate(Reason, StateName, StatData) ->
   	lager:info("BcAiFsm crashed with reason: ~p", [Reason]),
       ok.
   
  +-spec code_change(OldVsn, StateName :: atom(), 
  +				  StateData :: term(), 
  +				  Extra :: term()) -> {ok, NextStateName :: atom(), NewStateData :: term()} when
  +	OldVsn :: Vsn | {down, Vsn},
  +	Vsn :: term().
   code_change(OldVsn, StateName, StateData, Extra) ->
       {ok, StateName, StateData}.
   
  
positive.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);
  
negative.code: 			InRangeEnemyBcEntity = lists:nth(1, InRangeEnemyBcEntities),
  			EnemyBcEntity = 
  				lists:foldl(
  					fun(BcEntity, AccBcEntity) ->
  						case bc_entity:health(BcEntity) < 
  								bc_entity:health(AccBcEntity) of
  							true -> BcEntity;
  							false -> AccBcEntity
  						end 
  