anchor.diff:  	{ok, Service2, 0, Rated1};
   rate6(#service{session_attributes = SessionList} =
   		Service1, Buckets, final, _Charge, _Charged, 0, 0,
  -		#{session_id := SessionId, rated := Rated, product := P,
  -		session_id := SessionId, buckets := OldBuckets}) ->
  +		#state{rated = Rated, product = P, session_id = SessionId,
  +		buckets = OldBuckets}) ->
   	NewBuckets1 = refund(SessionId, Buckets),
   	{Seconds, Octets, Cents, Msgs, NewBuckets2} = get_debits(SessionId, NewBuckets1),
   	NewBRefs = update_buckets(P#product.balance, OldBuckets, NewBuckets2),
  
positive.code: 	ok = mnesia:write(Service2),
  	{grant, Service2, Reserved};
  rate6(Service, Buckets, interim, _Charge, _Charged, _Reserve, Reserved,
  		#{buckets := OldBuckets, product := P}) ->
  	NewBRefs = update_buckets(P#product.balance, OldBuckets, Buckets),
  	ok = mnesia:write(P#product{balance = NewBRefs}),
  	ok = mnesia:write(Service),
  
negative.code: 		[#offer{name = OfferName} = Offer | _] = lists:foldl(F, [], Bundle),
  		rate2(Protocol, Service, Buckets, Timestamp,
  				Address, Direction, Offer, Flag, DebitAmounts,
  				ReserveAmounts, State#state{rated = #rated{product = OfferName}})
  	catch
  		_:_ ->
  			throw(invalid_bundle_product)
  