anchor.diff:  		#state{session_id = SessionId} = State) ->
   	case update_session(Units, Damount, Ramount, SessionId, Buckets) of
   		{Damount, UnitsReserved, Buckets2} when UnitsReserved >= Ramount ->
  -erlang:display({?MODULE, ?LINE, Damount, UnitsReserved, Buckets}),
   			rate7(Service, Buckets2, interim, DebitAmount, DebitAmount,
   					ReserveAmount, {Units, UnitsReserved}, State);
   		{Damount, UnitsReserved, Buckets2} when UnitsReserved < Ramount ->
  -erlang:display({?MODULE, ?LINE, Damount, Ramount, UnitsReserved, Buckets2}),
   			NewReserveUnits = Ramount - UnitsReserved,
   			{UnitReserve, PriceReserve} = price_units(NewReserveUnits,
   					UnitSize, UnitPrice),
  -erlang:display({?MODULE, ?LINE, PriceReserve, Units, UnitReserve, SessionId}),
   			case convert(PriceReserve, Units, UnitReserve, SessionId, Buckets2) of
   				{ok, Buckets3} ->
  -erlang:display({?MODULE, ?LINE, Buckets3}),
   					{0, UnitReserve, Buckets4} = update_session(Units, 0,
   							NewReserveUnits, SessionId, Buckets3),
  -erlang:display({?MODULE, ?LINE, Buckets4}),
   					rate7(Service, Buckets4, interim,
   							DebitAmount, DebitAmount, ReserveAmount,
   							{Units, UnitsReserved + UnitReserve}, State);
  
positive.code: 					reservations = [NewReservation | NewReservations]} | Acc],
  			update_session(Type, 0, Reserve - Remain, Now, SessionId,
  					T, NewAcc, Charged + Charge, Reserved + Remain);
  % charge and partial reserve
  		{value, {_, DebitedAmount, ReservedAmount, _}, NewReservations}
  				when Charge > ReservedAmount, Remain >= (Charge - ReservedAmount),
  				Reserve > (Remain + (Charge - ReservedAmount)) ->
  erlang:display({?MODULE, ?LINE, Type, Charge, Reserve, DebitedAmount, ReservedAmount}),
  			NewDebitedAmount = DebitedAmount + Charge,
  			NewReserve = Remain - (Charge - ReservedAmount),
  			NewReservation = {Now, NewDebitedAmount, NewReserve, SessionId},
  
negative.code: 			update_session(Type, 0, Reserve - NewReserve, Now, SessionId,
  					T, NewAcc, Charged + Charge, Reserved + NewReserve);
  		_Other ->
  			update_session(Type, Charge, Reserve, Now, SessionId,
  					T, [B | Acc], Charged, Reserved)
  	end;
  update_session(Type, Charge, Reserve, Now, SessionId,
  		[H | T], Acc, Charged, Reserved) ->
  	update_session(Type, Charge, Reserve, Now, SessionId,
  			T, [H | Acc], Charged, Reserved);
  update_session(_, 0, Reserved, _, _, [], Acc, Charged, Reserved) ->
  	{Charged, Reserved, lists:reverse(Acc)};
  update_session(Type, Charge, Reserve, Now, SessionId, [], Acc, Charged, Reserved) ->
  	update(Type, Charge, Reserve, Now, SessionId, lists:reverse(Acc), [], Charged, Reserved).
  