anchor.diff:  			{error, Reason}
   	end.
   %% @hidden
  -reserve_units1(?initial, Product, UnitType, Flag, ReserveAmount, _DebitAmount, Validity, Buckets) ->
  -	case determinate_units(Product, UnitType, Flag, ReserveAmount, Validity, Buckets) of
  +reserve_units1(?initial, Product, Subscriber, UnitType, Flag, ReserveAmount, _DebitAmount, Validity, Buckets) ->
  +	case debit_units(Subscriber, Product, UnitType, Flag, ReserveAmount, Validity, Buckets) of
   		{Charged, _NewBuckets} when Charged =< 0 ->
   			out_of_credit;
   		{_Chraged, _NewBuckets} ->
   			{grant, ReserveAmount}
   	end.
   reserve_units1(_, Product, Subscriber, UnitType, Flag, ReserveAmount, DebitAmount, Validity, Buckets) ->
  -	case determinate_units(Product, UnitType, Flag, DebitAmount, Validity, Buckets) of
  +	case debit_units(Subscriber, Product, UnitType, Flag, DebitAmount, Validity, Buckets) of
   		{Charged, NewBuckets} when Charged =< 0 andalso DebitAmount =/= 0 ->
  -			mnesia:write(Subscriber#subscriber{buckets = NewBuckets}),
   			out_of_credit;
   		{_Charged, NewBuckets} ->	
  -			mnesia:write(Subscriber#subscriber{buckets = NewBuckets}),
  -			case determinate_units(Product, UnitType, Flag, ReserveAmount, Validity, Buckets) of
  +			case debit_units(Subscriber, Product, UnitType, Flag, ReserveAmount, Validity, Buckets) of
   				{Ch1, _NB1} when Ch1 =< 0 andalso ReserveAmount =/=0  ->
   					out_of_credit;
   				_ ->
  
positive.code: 					case RequestType of
  						?initial ->
  							SA = update_session(SessionId, SessionIdentification, SessionAttributes, []),
  							case reserve_units1(?initial, Product, UnitType,
  									false, ReserveAmount, DebitAmount, Validity, Buckets) of
  								out_of_credit ->
  									mnesia:write(Subscriber#subscriber{session_attributes = []}),
  
negative.code: 					throw(price_not_found)
  			end;
  		{Charged, NewBuckets} ->
  			mnesia:write(Subscriber#subscriber{buckets = NewBuckets}),
  			{Charged, NewBuckets}
  	end.
  
  