anchor.diff:  	end,
   	%% 1st Reservation
   	Reservation1 = 100,
  -	{ok, _, _} = ocs_rating:rate(diameter, SubscriberID, Destination, initial, [], [{octets, Reservation1}], SessionId),
  -	{ok, #subscriber{buckets = RatedBuckets1}} = ocs:find_subscriber(SubscriberID),
  -	#bucket{remain_amount = CentsRemain1, reservations = Reservations1} =
  -			lists:keyfind(cents, #bucket.units, RatedBuckets1),
  +	{ok, #subscriber{buckets = [#bucket{remain_amount = CentsRemain1,
  +			reservations = [{_, Reserved1, _}]}]}, PackageSize}
  +			= ocs_rating:rate(diameter, SubscriberID, Destination,
  +			initial, [], [{octets, Reservation1}], SessionId),
   	CentsRemain1 = RemAmount - F(Reservation1),
  -	{_, Reserved1, _} = lists:keyfind(SessionId, 3, Reservations1),
   	Reserved1 = F(Reservation1),
   	%% 2nd Reservation
   	Reservation2 = 300,
  -	{ok, _, _} = ocs_rating:rate(diameter, SubscriberID, Destination, interim, [], [{octets, Reservation2}], SessionId),
  -	{ok, #subscriber{buckets = RatedBuckets2}} = ocs:find_subscriber(SubscriberID),
  -	#bucket{remain_amount = CentsRemain2, reservations = Reservations2} =
  -			lists:keyfind(cents, #bucket.units, RatedBuckets2),
  +	{ok, #subscriber{buckets = [#bucket{remain_amount = CentsRemain2,
  +			reservations = [{_, Reserved2, _}]}]}, PackageSize}
  +			= ocs_rating:rate(diameter, SubscriberID, Destination,
  +			interim, [], [{octets, Reservation2}], SessionId),
   	CentsRemain2 = RemAmount - F(Reservation2),
  -	{_, Reserved2, _} = lists:keyfind(SessionId, 3, Reservations2),
   	Reserved2 = F(Reservation2),
   	%% 3rd Reservation
   	Reservation3 = 700,
  -	{ok, _, _} = ocs_rating:rate(diameter, SubscriberID, Destination, interim, [], [{octets, Reservation3}], SessionId),
  -	{ok, #subscriber{buckets = RatedBuckets3}} = ocs:find_subscriber(SubscriberID),
  -	#bucket{remain_amount = CentsRemain3, reservations = Reservations3} =
  -			lists:keyfind(cents, #bucket.units, RatedBuckets3),
  +	{ok, #subscriber{buckets = [#bucket{remain_amount = CentsRemain3,
  +			reservations = [{_, Reserved3, _}]}]}, PackageSize}
  +			= ocs_rating:rate(diameter, SubscriberID, Destination,
  +			interim, [], [{octets, Reservation3}], SessionId),
   	CentsRemain3 = RemAmount - F(Reservation3),
  -	{_, Reserved3, _} = lists:keyfind(SessionId, 3, Reservations3),
   	Reserved3 = F(Reservation3).
   
   interim_reservation_available_remain_amount() ->
  
positive.code: 	NasId = [{?NasIpAddress, ocs:generate_password()}],
  	SessionAttr = SessionId ++ NasIp ++ NasId,
  	{ok, _} = ocs:add_subscriber(SubscriberID, Password, ProdID, Chars, Buckets),
  	{ok, #subscriber{session_attributes = [{_, SessionAttr}]}, _} = ocs_rating:rate(radius,
  			SubscriberID, Destination, initial, [], [{octets, PackageSize}], SessionAttr).
  
  initial_overhead() ->
  	[{userdata, [{doc, "Reserved amount greater than requested reservation amount"}]}].
  
negative.code: 		start_date = erlang:system_time(?MILLISECOND),
  		termination_date = erlang:system_time(?MILLISECOND) + 2592000000}],
  	Destination = ocs:generate_identity(),
  	{ok, _Subscriber1} = ocs:add_subscriber(SubscriberID,
  			Password, ProdID, Chars, Buckets),
  	SessionId = [{'Session-Id', list_to_binary(ocs:generate_password())}],
  	{ok, _Subscriber2, PackageSize} = ocs_rating:rate(diameter, SubscriberID,
  			Destination, initial, [], [{octets, PackageSize}], SessionId),
  	{ok, #subscriber{buckets = [#bucket{remain_amount = 0,
  			reservations = [{_, PackagePrice, _}]}]}, PackageSize}
  			= ocs_rating:rate(diameter, SubscriberID, Destination, interim,
  			[{octets, PackageSize}], [{octets, PackageSize}], SessionId).
  
  interim_reservation_out_of_credit() ->
  	[{userdata, [{doc, "Out of credit on reservation"}]}].
  
  interim_reservation_out_of_credit(_Config) ->
  	ProdID = ocs:generate_password(),
  	PackagePrice = 100,
  	PackageSize = 1000,
  	Price = #price{name = "overage", type = usage,
  		units = octets, size = PackageSize, amount = PackagePrice},
  	Product1 = #product{name = ProdID, price = [Price]},
  	{ok, _Product2} = ocs:add_product(Product1),
  	SubscriberID = list_to_binary(ocs:generate_identity()),
  	Password = ocs:generate_password(),
  	Chars = [{validity, erlang:system_time(?MILLISECOND) + 2592000000}],
  	RemAmount = 110,
  	Buckets = [#bucket{units = cents, remain_amount = RemAmount,
  		start_date = erlang:system_time(?MILLISECOND),
  		termination_date = erlang:system_time(?MILLISECOND) + 2592000000}],
  	{ok, _Subscriber1} = ocs:add_subscriber(SubscriberID,
  			Password, ProdID, Chars, Buckets),
  	SessionId = [{'Session-Id', list_to_binary(ocs:generate_password())}],
  	Destination = ocs:generate_identity(),
  	{ok, _Subscriber2, PackageSize} = ocs_rating:rate(diameter, SubscriberID,
  			Destination, initial, [], [{octets, PackageSize}], SessionId),
  	{out_of_credit, _} = ocs_rating:rate(diameter, SubscriberID, Destination,
  			interim, [], [{octets, 2 * PackageSize}], SessionId),
  	{ok, #subscriber{buckets = RatedBuckets}} = ocs:find_subscriber(SubscriberID),
  	#bucket{remain_amount = 0} = lists:keyfind(cents, #bucket.units, RatedBuckets).
  
  