anchor.diff:          KVb = <<"[1,b]",9,"234567">>,
           KVc = <<"[1,c]",9,"345678">>,
   
  -        ?assertEqual({ok,[<<"[1,a]",9,"undefined">>]}, read(Channel, <<"kvpair">>, <<"[1,a]">>)),
  -        ?assertEqual({ok,[<<"[1,a]",9,"undefined">>]}, read(Channel, <<"khpair">>, <<"[1,a]">>)),
  -        ?assertEqual({ok,[<<"[1,a]">>]}, read(Channel, <<"key">>, <<"[1,a]">>)),
  -        ?assertEqual({ok,[<<"undefined">>]}, read(Channel, <<"value">>, <<"[1,a]">>)),
  -        ?assertEqual({ok,[<<"undefined">>]}, read(Channel, <<"hash">>, <<"[1,a]">>)),
  +
  +        ?assertEqual({ok,[{1,<<"[1,a]\tundefined">>}]}, read(Channel, <<"kvpair">>, <<"[1,a]">>)),
  +        ?assertEqual({ok,[{1,<<"[1,a]\tundefined">>}]}, read(Channel, <<"khpair">>, <<"[1,a]">>)),
  +        ?assertEqual({ok,[{1,<<"[1,a]">>}]}, read(Channel, <<"key">>, <<"[1,a]">>)),
  +        ?assertEqual({ok,[{1,<<"undefined">>}]}, read(Channel, <<"value">>, <<"[1,a]">>)),
  +        ?assertEqual({ok,[{1,<<"undefined">>}]}, read(Channel, <<"hash">>, <<"[1,a]">>)),
   
           ?assertEqual(ok, imem_meta:check_table(skvhTEST)),        
           ?assertEqual(ok, imem_meta:check_table(skvhAuditTEST_86400@)),
   
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
  -
  -        ?assertEqual({ok,[KVa]}, read(Channel, <<"kvpair">>, <<"[1,a]">>)),
  -        ?assertEqual({ok,[KVc]}, read(Channel, <<"kvpair">>, <<"[1,c]">>)),
  -        ?assertEqual({ok,[KVb]}, read(Channel, <<"kvpair">>, <<"[1,b]">>)),
  -        ?assertEqual({ok,[<<"[1,c]",9,"117221887">>]}, read(Channel, <<"khpair">>, <<"[1,c]">>)),
  -        ?assertEqual({ok,[<<"124793159">>]}, read(Channel, <<"hash">>, <<"[1,b]">>)),
  -
  -        ?assertEqual({ok,[KVc,KVb,KVa]}, read(Channel, <<"kvpair">>, <<"[1,c]",13,10,"[1,b]",10,"[1,a]">>)),
  -        ?assertEqual({ok,[KVa,<<"[1,ab]",9,"undefined">>,KVb,KVc]}, read(Channel, <<"kvpair">>, <<"[1,a]",13,10,"[1,ab]",13,10,"[1,b]",10,"[1,c]">>)),
  -
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, delete(Channel, <<"[1,a]",10,"[1,b]",13,10,"[1,c]",10>>)),
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
  +
  +        ?assertEqual({ok,[{1,KVa}]}, read(Channel, <<"kvpair">>, <<"[1,a]">>)),
  +        ?assertEqual({ok,[{1,KVc}]}, read(Channel, <<"kvpair">>, <<"[1,c]">>)),
  +        ?assertEqual({ok,[{1,KVb}]}, read(Channel, <<"kvpair">>, <<"[1,b]">>)),
  +        ?assertEqual({ok,[{1,<<"[1,c]",9,"1XSGZJ">>}]}, read(Channel, <<"khpair">>, <<"[1,c]">>)),
  +        ?assertEqual({ok,[{1,<<"22AR0N">>}]}, read(Channel, <<"hash">>, <<"[1,b]">>)),
  +
  +        ?assertEqual({ok,[{1,KVc},{1,KVb},{1,KVa}]}, read(Channel, <<"kvpair">>, <<"[1,c]",13,10,"[1,b]",10,"[1,a]">>)),
  +        ?assertEqual({ok,[{1,KVa},{1,<<"[1,ab]",9,"undefined">>},{1,KVb},{1,KVc}]}, read(Channel, <<"kvpair">>, <<"[1,a]",13,10,"[1,ab]",13,10,"[1,b]",10,"[1,c]">>)),
  +
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, delete(Channel, <<"[1,a]",10,"[1,b]",13,10,"[1,c]",10>>)),
   
           Aud = imem_meta:read(skvhAuditTEST_86400@),
           ?Info("audit trail~n~p~n", [Aud]),
           ?assertEqual(6, length(Aud)),
   
  -        ?assertEqual({ok,[<<"[1,a]",9,"undefined">>]}, read(Channel, <<"kvpair">>, <<"[1,a]">>)),
  -        ?assertEqual({ok,[<<"[1,b]",9,"undefined">>]}, read(Channel, <<"kvpair">>, <<"[1,b]">>)),
  -        ?assertEqual({ok,[<<"[1,c]",9,"undefined">>]}, read(Channel, <<"kvpair">>, <<"[1,c]">>)),
  -
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
  +        ?assertEqual({ok,[{1,<<"[1,a]",9,"undefined">>}]}, read(Channel, <<"kvpair">>, <<"[1,a]">>)),
  +        ?assertEqual({ok,[{1,<<"[1,b]",9,"undefined">>}]}, read(Channel, <<"kvpair">>, <<"[1,b]">>)),
  +        ?assertEqual({ok,[{1,<<"[1,c]",9,"undefined">>}]}, read(Channel, <<"kvpair">>, <<"[1,c]">>)),
  +
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
   
   		?assertEqual({ok,[]},deleteGELT(Channel, <<"[]">>, <<"[]">>)),
   		?assertEqual({ok,[]},deleteGELT(Channel, <<"[]">>, <<"[1,a]">>)),
   
  -		?assertEqual({ok,[<<"1296644">>]},deleteGELT(Channel, <<"[]">>, <<"[1,ab]">>)),
  +		?assertEqual({ok,[{1,<<"RSHW">>}]},deleteGELT(Channel, <<"[]">>, <<"[1,ab]">>)),
   		?assertEqual({ok,[]},deleteGELT(Channel, <<"[]">>, <<"[1,ab]">>)),
   
  -		?assertEqual({ok,[<<"124793159">>,<<"117221887">>]},deleteGELT(Channel, <<"[1,ab]">>, <<"[1,d]">>)),		
  +		?assertEqual({ok,[{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]},deleteGELT(Channel, <<"[1,ab]">>, <<"[1,d]">>)),		
   		?assertEqual({ok,[]},deleteGELT(Channel, <<"[1,ab]">>, <<"[1,d]">>)),
   
  -        ?assertEqual({ok,[<<"undefined">>,<<"undefined">>,<<"undefined">>]}, delete(Channel, <<"[1,a]",10,"[1,b]",13,10,"[1,c]",10>>)),
  -
  -        ?assertEqual({ok,[<<"73740797">>]}, write(Channel, <<"[90074,[],\"AaaEnabled\"]",9,"true">>)),
  -		?assertEqual({ok,[<<"81705319">>]}, write(Channel, <<"[90074,[],\"ContentSizeMax\"]",9,"297000">>)),
  -		?assertEqual({ok,[<<"99247098">>]}, write(Channel, <<"[90074,[],<<\"MmscId\">>]",9,"\"testMMSC\"">>)),
  -		?assertEqual({ok,[<<"55096411">>]}, write(Channel, <<"[90074,\"MMS-DEL-90074\",\"TpDeliverUrl\"]",9,"\"http:\/\/10.132.30.84:18888\/deliver\"">>)),
  +        ?assertEqual({ok,[{1,<<"undefined">>},{1,<<"undefined">>},{1,<<"undefined">>}]}, delete(Channel, <<"[1,a]",10,"[1,b]",13,10,"[1,c]",10>>)),
  +
  +        ?assertEqual({ok,[{1,<<"17WIRH">>}]}, write(Channel, <<"[90074,[],\"AaaEnabled\"]",9,"true">>)),
  +		?assertEqual({ok,[{1,<<"1CN887">>}]}, write(Channel, <<"[90074,[],\"ContentSizeMax\"]",9,"297000">>)),
  +		?assertEqual({ok,[{1,<<"1N37JU">>}]}, write(Channel, <<"[90074,[],<<\"MmscId\">>]",9,"\"testMMSC\"">>)),
  +		?assertEqual({ok,[{1,<<"WSWNV">>}]}, write(Channel, <<"[90074,\"MMS-DEL-90074\",\"TpDeliverUrl\"]",9,"\"http:\/\/10.132.30.84:18888\/deliver\"">>)),
   
           ?Info("audit trail~n~p~n", [imem_meta:read(skvhAuditTEST_86400@)]),
   
   		?assertEqual(ok,imem_meta:drop_table(skvhTEST)),
   
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
   
   		?assertEqual({ok,[]},deleteGTLT(Channel, <<"[]">>, <<"[]">>)),
   		?assertEqual({ok,[]},deleteGTLT(Channel, <<"[]">>, <<"[1,a]">>)),
   
  -		?assertEqual({ok,[<<"1296644">>]},deleteGTLT(Channel, <<"[]">>, <<"[1,ab]">>)),
  +		?assertEqual({ok,[{1,<<"RSHW">>}]},deleteGTLT(Channel, <<"[]">>, <<"[1,ab]">>)),
   		?assertEqual({ok,[]},deleteGTLT(Channel, <<"[]">>, <<"[1,ab]">>)),
   
  -		?assertEqual({ok,[<<"117221887">>]},deleteGTLT(Channel, <<"[1,b]">>, <<"[1,d]">>)),		
  +		?assertEqual({ok,[{1,<<"1XSGZJ">>}]},deleteGTLT(Channel, <<"[1,b]">>, <<"[1,d]">>)),		
   		?assertEqual({ok,[]},deleteGTLT(Channel, <<"[1,b]">>, <<"[1,d]">>)),
   
  -		?assertEqual({ok,[<<"124793159">>]},deleteGTLT(Channel, <<"[1,a]">>, <<"[1,c]">>)),		
  +		?assertEqual({ok,[{1,<<"22AR0N">>}]},deleteGTLT(Channel, <<"[1,a]">>, <<"[1,c]">>)),		
   		?assertEqual({ok,[]},deleteGTLT(Channel, <<"[1,a]">>, <<"[1,c]">>)),		
   
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
  -
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, readGELT(Channel, <<"hash">>, <<"[]">>, <<"[1,d]">>)),
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, readGELT(Channel, <<"hash">>, <<"[1,a]">>, <<"[1,d]">>)),
  -    	?assertEqual({ok,[<<"124793159">>,<<"117221887">>]}, readGELT(Channel, <<"hash">>, <<"[1,ab]">>, <<"[1,d]">>)),
  -    	?assertEqual({ok,[<<"[1,b]">>]}, readGELT(Channel, <<"key">>, <<"[1,ab]">>, <<"[1,c]">>)),
  -    	?assertEqual({ok,[<<"234567">>]}, readGELT(Channel, <<"value">>, <<"[1,ab]">>, <<"[1,c]">>)),
  -    	?assertEqual({ok,[<<"[1,b]",9,"234567">>]}, readGELT(Channel, <<"kvpair">>, <<"[1,ab]">>, <<"[1,c]">>)),
  -    	?assertEqual({ok,[<<"[1,b]",9,"124793159">>]}, readGELT(Channel, <<"khpair">>, <<"[1,ab]">>, <<"[1,c]">>)),
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, write(Channel, <<"[1,a]",9,"123456",10,"[1,b]",9,"234567",13,10,"[1,c]",9,"345678">>)),
  +
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, readGELT(Channel, <<"hash">>, <<"[]">>, <<"[1,d]">>)),
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, readGELT(Channel, <<"hash">>, <<"[1,a]">>, <<"[1,d]">>)),
  +    	?assertEqual({ok,[{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, readGELT(Channel, <<"hash">>, <<"[1,ab]">>, <<"[1,d]">>)),
  +    	?assertEqual({ok,[{1,<<"[1,b]">>}]}, readGELT(Channel, <<"key">>, <<"[1,ab]">>, <<"[1,c]">>)),
  +    	?assertEqual({ok,[{1,<<"234567">>}]}, readGELT(Channel, <<"value">>, <<"[1,ab]">>, <<"[1,c]">>)),
  +    	?assertEqual({ok,[{1,<<"[1,b]",9,"234567">>}]}, readGELT(Channel, <<"kvpair">>, <<"[1,ab]">>, <<"[1,c]">>)),
  +    	?assertEqual({ok,[{1,<<"[1,b]",9,"22AR0N">>}]}, readGELT(Channel, <<"khpair">>, <<"[1,ab]">>, <<"[1,c]">>)),
  +    	?assertEqual({ok,[{1,<<"[1,b]",9,"234567",9,"22AR0N">>}]}, readGELT(Channel, <<"kvhtriple">>, <<"[1,ab]">>, <<"[1,c]">>)),
    
       	?assertEqual(ok, imem_meta:drop_table(skvhAuditTEST_86400@)),
   
  -        ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, readGT(Channel, <<"hash">>, <<"[]">>, <<"1000">>)),
  -        ?assertEqual({ok,[<<"124793159">>,<<"117221887">>]}, readGT(Channel, <<"hash">>, <<"[1,a]">>, <<"1000">>)),
  -    	?assertEqual({ok,[<<"124793159">>]}, readGT(Channel, <<"hash">>, <<"[1,a]">>, <<"1">>)),
  -    	?assertEqual({ok,[<<"[1,b]">>,<<"[1,c]">>]}, readGT(Channel, <<"key">>, <<"[1,a]">>, <<"2">>)),
  -    	?assertEqual({ok,[<<"234567">>]}, readGT(Channel, <<"value">>, <<"[1,ab]">>, <<"1">>)),
  -    	?assertEqual({ok,[<<"[1,b]",9,"234567">>]}, readGT(Channel, <<"kvpair">>, <<"[1,ab]">>, <<"1">>)),
  -    	?assertEqual({ok,[<<"[1,b]",9,"124793159">>]}, readGT(Channel, <<"khpair">>, <<"[1,ab]">>, <<"1">>)),
  +        ?assertEqual({ok,[{1,<<"RSHW">>},{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, readGT(Channel, <<"hash">>, <<"[]">>, <<"1000">>)),
  +        ?assertEqual({ok,[{1,<<"22AR0N">>},{1,<<"1XSGZJ">>}]}, readGT(Channel, <<"hash">>, <<"[1,a]">>, <<"1000">>)),
  +    	?assertEqual({ok,[{1,<<"22AR0N">>}]}, readGT(Channel, <<"hash">>, <<"[1,a]">>, <<"1">>)),
  +    	?assertEqual({ok,[{1,<<"[1,b]">>},{1,<<"[1,c]">>}]}, readGT(Channel, <<"key">>, <<"[1,a]">>, <<"2">>)),
  +    	?assertEqual({ok,[{1,<<"234567">>}]}, readGT(Channel, <<"value">>, <<"[1,ab]">>, <<"1">>)),
  +    	?assertEqual({ok,[{1,<<"[1,b]",9,"234567">>}]}, readGT(Channel, <<"kvpair">>, <<"[1,ab]">>, <<"1">>)),
  +    	?assertEqual({ok,[{1,<<"[1,b]",9,"22AR0N">>}]}, readGT(Channel, <<"khpair">>, <<"[1,ab]">>, <<"1">>)),
   
           ?assertEqual(ok, imem_meta:drop_table(skvhTEST)),
           ?assertEqual(ok, imem_meta:drop_table(skvhAuditTEST_86400@)),
  
positive.code: 
  -record(skvhTable,                            %% sorted key value hash table    
                      { ckey                    :: term()
                      , cvalue               	  :: binary()      
                      , chash                   :: term()
                      }
         ).
  -define(skvhTable,  [term,binstr,term]).
  
  -record(skvhAudit,                            %% sorted key value hash audit table    
                      { time                    :: ddTimestamp()	%% erlang:now()
  
negative.code: % 	debug(Cmd, Tuple), 
  % 	{error,Tuple}.
  
  return_stringlist(Cmd, List) -> 
  	debug(Cmd, List), 
  	{ok,[{?typeStr,E} || E <- List]}.
  
  % return_tuple(Cmd, Tuple) -> 
  % 	debug(Cmd, Tuple), 
  