anchor.diff:  	NewSessionList = remove_session(SessionAttributes, SessionList),
   	Subscriber2 = Subscriber1#subscriber{session_attributes = NewSessionList},
   	ok = mnesia:write(Subscriber2),
  -erlang:display({?MODULE, ?LINE, grant, Subscriber2, Charged}),
   	{grant, Subscriber2, Charged};
   rate6(#subscriber{session_attributes = SessionList} = Subscriber1,
   		final, _Charge, _Charged, 0, 0, _SessionAttributes) ->
   	Subscriber2 = Subscriber1#subscriber{session_attributes = []},
   	ok = mnesia:write(Subscriber2),
  -erlang:display({?MODULE, ?LINE, out_of_credit, Subscriber2, SessionList}),
   	{out_of_credit, SessionList};
   rate6(#subscriber{enabled = false,
   		session_attributes = SessionList} = Subscriber1, _Flag,
   		_Charge, _Charged, _Reserve, _Reserved, _SessionAttributes) ->
   	Subscriber2 = Subscriber1#subscriber{session_attributes = []},
   	ok = mnesia:write(Subscriber2),
  -erlang:display({?MODULE, ?LINE, disabled, SessionList}),
   	{disabled, SessionList};
   rate6(#subscriber{session_attributes = SessionList} = Subscriber1, _Flag,
   		Charge, Charged, Reserve, Reserved, _SessionAttributes)
   		when Charged < Charge; Reserved <  Reserve ->
   	Subscriber2 = Subscriber1#subscriber{session_attributes = []},
   	ok = mnesia:write(Subscriber2),
  -erlang:display({?MODULE, ?LINE, out_of_credit, Subscriber2, SessionList}),
   	{out_of_credit, SessionList};
   rate6(#subscriber{session_attributes = SessionList} = Subscriber1,
   		initial, 0, 0, _Reserve, Reserved, SessionAttributes) ->
   	NewSessionList = add_session(SessionAttributes, SessionList),
   	Subscriber2 = Subscriber1#subscriber{session_attributes = NewSessionList},
   	ok = mnesia:write(Subscriber2),
  -erlang:display({?MODULE, ?LINE, grant, Subscriber2, Reserved}),
   	{grant, Subscriber2, Reserved};
   rate6(Subscriber, interim, _Charge, _Charged, _Reserve, Reserved, _SessionAttributes) ->
   	ok = mnesia:write(Subscriber),
  -erlang:display({?MODULE, ?LINE, grant, Subscriber, Reserved}),
   	{grant, Subscriber, Reserved}.
   
   %%----------------------------------------------------------------------
  
positive.code: 					rate6(Subscriber#subscriber{buckets = Buckets3}, interim,
  							DebitAmount, UnitsCharged + (PriceCharged div UnitPrice),
  							0, 0, SessionAttributes)
  ; Other -> erlang:display({?MODULE, ?LINE, Other})
  			end
  ; Other -> erlang:display({?MODULE, ?LINE, Other})
  	end;
  rate5(#subscriber{buckets = Buckets1} = Subscriber,
  		#price{units = Units, size = UnitSize, amount = UnitPrice},
  		_Validity, interim, DebitAmount, ReserveAmount, SessionAttributes) ->
  	SessionId = get_session_id(SessionAttributes),
  erlang:display({?MODULE, ?LINE, DebitAmount, ReserveAmount, Units}),
  	case update_session(Units, DebitAmount, ReserveAmount,
  			SessionId, Buckets1) of
  		{DebitAmount, ReserveAmount, Buckets2} ->
  erlang:display({?MODULE, ?LINE, DebitAmount, ReserveAmount, Buckets2}),
  			rate6(Subscriber#subscriber{buckets = Buckets2}, interim,
  					DebitAmount, DebitAmount, ReserveAmount, ReserveAmount,
  					SessionAttributes);
  		{DebitAmount, UnitsReserved, Buckets2} ->
  erlang:display({?MODULE, ?LINE, DebitAmount, UnitsReserved, Buckets2}),
  			PriceReserveUnits = ReserveAmount - UnitsReserved,
  			{UnitReserve, PriceReserve} = price_units(PriceReserveUnits,
  					UnitSize, UnitPrice),
  			case update_session(cents, 0, PriceReserve, SessionId, Buckets2) of
  				{0, PriceReserve, Buckets3} ->
  erlang:display({?MODULE, ?LINE, PriceReserve, Buckets3}),
  					rate6(Subscriber#subscriber{buckets = Buckets3}, interim,
  							DebitAmount, DebitAmount, ReserveAmount,
  							UnitReserve, SessionAttributes);
  				{0, PriceReserved, Buckets3} ->
  erlang:display({?MODULE, ?LINE, PriceReserve, Buckets3}),
  					rate6(Subscriber#subscriber{buckets = Buckets3}, interim,
  							DebitAmount, DebitAmount, ReserveAmount,
  							UnitsReserved + PriceReserved div UnitPrice,
  							SessionAttributes)
  			end;
  		{UnitsCharged, 0, Buckets2} ->
  erlang:display({?MODULE, ?LINE, UnitsCharged, Buckets2}),
  			PriceChargeUnits = DebitAmount - UnitsCharged,
  			{UnitCharge, PriceCharge} = price_units(PriceChargeUnits,
  					UnitSize, UnitPrice),
  
negative.code: 			remove_session(SessionAttributes, T, [H | T])
  	end;
  remove_session(SessionAttributes, [], Acc) ->
  	lists:reverse(Acc).
  
  -spec add_session(SessionAttributes, SessionList) -> SessionList
  