anchor.diff:  					reservations = [NewReservation | NewReservations]} | Acc],
   			update_session(Type, Charge, Reserve, Now, ServiceId, ChargingKey,
   					SessionId, T, NewAcc, Charged + NewCharge, Reserved + NewReserve);
  -		{value, {_, DebitedAmount, ReservedAmount,
  -				ServiceId, ChargingKey, _}, NewReservations}
  +		{[{_, DebitedAmount, ReservedAmount,
  +				ServiceId, ChargingKey, _}], NewReservations}
   				when (ReservedAmount - NewCharge) >= 0 ->
   			NewReserved = ReservedAmount - NewCharge,
   			NewReservation = {Now, DebitedAmount + NewCharge, NewReserved,
  
positive.code: update_session1(Type, Charge, Reserve, Now, ServiceId, ChargingKey, SessionId,
  		[#bucket{units = Type, remain_amount = Remain,
  		reservations = Reservations} = B | T], Acc, Charged, Reserved)
  		when Reserve > Reserved, Remain > 0 ->
  	NewReserve = Reserve - Reserved,
  	case lists:keytake(SessionId, 6, Reservations) of
  		{value, {_, DebitedAmount, ReservedAmount,
  				ServiceId, ChargingKey, _}, NewReservations}
  				when Remain >= NewReserve ->
  			NewRemain = Remain - NewReserve,
  			NewReservation = {Now, DebitedAmount, ReservedAmount + NewReserve,
  					ServiceId, ChargingKey, SessionId},
  			NewAcc = [B#bucket{remain_amount = NewRemain,
  					last_modified = {Now, erlang:unique_integer([positive])},
  					reservations = [NewReservation | NewReservations]} | Acc],
  			update_session1(Type, Charge, Reserve, Now, ServiceId, ChargingKey,
  					SessionId, T, NewAcc, Charged, Reserved + NewReserve);
  		{value, {_, DebitedAmount, ReservedAmount,
  				ServiceId, ChargingKey, _}, NewReservations}
  				when Remain > 0 ->
  			NewReservation = {Now, DebitedAmount, ReservedAmount + Remain,
  					ServiceId, ChargingKey, SessionId},
  			NewAcc = [B#bucket{last_modified = {Now, erlang:unique_integer([positive])},
  					reservations = [NewReservation | NewReservations]} | Acc],
  			update_session1(Type, Charge, Reserve, Now, ServiceId, ChargingKey,
  					SessionId, T, NewAcc, Charged, Reserved + Remain);
  		_Other ->
  			update_session1(Type, Charge, Reserve, Now, ServiceId, ChargingKey,
  					SessionId, T, [B | Acc], Charged, Reserved)
  	end;
  update_session1(_, Charge, Reserve, _, _, _, _, Buckets, Acc, Charged, Reserved)
  		when Charge =:= Charged, Reserve =:= Reserved ->
  	{Charged, Reserved, lists:reverse(Acc) ++ Buckets};
  update_session1(Type, Charge, Reserve, Now, ServiceId, ChargingKey, SessionId,
  		Buckets, Acc, Charged, Reserved) when Reserve =:= Reserved ->
  	update(Type, Charge, Reserve, Now, ServiceId, ChargingKey, SessionId,
  			lists:reverse(Acc) ++ Buckets, [], Charged, Reserved);
  update_session1(Type, Charge, Reserve, Now, ServiceId, ChargingKey, SessionId,
  		[H | T], Acc, Charged, Reserved) ->
  	update_session1(Type, Charge, Reserve, Now, ServiceId, ChargingKey, SessionId,
  
negative.code: 					reservations = [NewReservation | NewReservations]} | Acc],
  			update_session(Type, Charge, Reserve, Now, ServiceId, ChargingKey,
  					SessionId, T, NewAcc, Charged + NewCharge, Reserved + NewReserved);
  		{[{_, DebitedAmount, ReservedAmount,
  				ServiceId, ChargingKey, _}], NewReservations}
  				when ReservedAmount > 0, NewCharge > ReservedAmount ->
  			NewReservation = {Now, DebitedAmount + ReservedAmount, 0,
  					ServiceId, ChargingKey, SessionId},
  