anchor.diff:  			end
   	end,
   	case mnesia:transaction(F) of
  -		{atomic, {grant, Sub, GrantAmount}} ->
  -			{ok, Sub, GrantAmount};
  +		{atomic, {grant, Sub, GrantedAmount}} ->
  +			{ok, Sub, GrantedAmount};
   		{atomic, {out_of_credit, SL}} ->
   			{out_of_credit, SL};
   		{aborted, {throw, Reason}} ->
  
positive.code: 		ReserveAmount :: [{Type, Amount}],
  		Type :: octets | seconds,
  		Amount :: integer(),
  		Result :: {ok, Subscriber, GrantAmount} | {out_of_credit, SessionList} | {error, Reason},
  		Subscriber :: #subscriber{},
  		GrantAmount :: integer(),
  		SessionList :: [tuple()],
  		Reason :: term().
  %% @equiv rate(SubscriberID, Flag, DebitAmount, ReserveAmount, [])
  
negative.code: 		SessionIdentification :: [tuple()],
  		Type :: octets | seconds,
  		Amount :: integer(),
  		Result :: {ok, Subscriber, GrantedAmount} | {out_of_credit, SessionList} | {error, Reason},
  		Subscriber :: #subscriber{},
  		GrantedAmount :: integer(),
  		SessionList :: [tuple()],
  		Reason :: term().
  %% @doc Handle rating and balance management for used and reserved unit amounts.
  %%
  %% 	Subscriber balance buckets are permanently reduced by the
  %% 	amount(s) in `DebitAmount' and `Type' buckets are allocated
  %% 	by the amount(s) in `ReserveAmount'. The subscribed product
  %% 	determines the price used to calculate the amount to be
  %% 	permanently debited from available `cents' buckets.
  %%
  %% 	Returns `{ok, Subscriber, GrantedAmount}' if successful or
  %% 	`{out_of_credit, SessionList}' if the subscriber's balance
  %% 	is insufficient to cover the `DebitAmount' and `ReserveAmount'.
  %% 	`SessionList' describes the known avtive sessions which
  %% 	should be disconnected.
  %%
  rate(SubscriberID, Flag, DebitAmount, ReserveAmount, SessionIdentification) when is_list(SubscriberID)->
  	rate(list_to_binary(SubscriberID), Flag, DebitAmount, ReserveAmount, SessionIdentification);
  rate(SubscriberID, Flag, DebitAmount, ReserveAmount, SessionIdentification)
  