anchor.diff:  	{L,true} = imem_meta:select(TN, [MatchFunction]),
   	delete(Cmd, {TN,AN}, L, []).
   
  -
  -readGT(_Channel, _Item, _CKey1, _Limit) ->
  -	ok.
  -
  -delete(Channel, KeyTable) when is_binary(Channel), is_binary(KeyTable) -> 
  -	Cmd = [delete,Channel,KeyTable],
  -	delete(Cmd, create_check_channel(Channel), key_table_to_term_list(KeyTable), []).
  -
  -delete(Cmd, _, [], Acc)  -> return_list(Cmd, lists:reverse(Acc));
  -delete(Cmd, {TN,AN}, [Key|Keys], Acc)  ->
  -	Hash = case imem_meta:read(TN,Key) of
  -		[] ->						undefined;
  -		[#skvhTable{chash=H}] ->	H
  -	end,
  -	imem_meta:delete(TN,Key),									%% ToDo: wrap in transaction
  -	imem_meta:write(AN,#skvhAudit{time=erlang:now(),ckey=Key}),	%% ToDo: wrap in transaction
  -	delete(Cmd, {TN,AN}, Keys, [Hash|Acc]).
  -
  -deleteGELT(Channel, CKey1, CKey2) when is_binary(Channel), is_binary(CKey1), is_binary(CKey2) ->
  -	Cmd = [deleteGELT, Channel, CKey1, CKey2],
  -	deleteGELT(Cmd, create_check_channel(Channel), key_to_term(CKey1), key_to_term(CKey2)).
  -
  -deleteGELT(Cmd, {TN,AN}, Key1, Key2) ->
  -	MatchHead = {skvhTable, '$1', '$2', '$3'},
  -	MatchFunction = {MatchHead, [{'>=', '$1', Key1}, {'<', '$1', Key2}], ['$1']},
  -	{L,true} = imem_meta:select(TN, [MatchFunction]),
  -	delete(Cmd, {TN,AN}, L, []).
  -
   deleteGTLT(Channel, CKey1, CKey2) when is_binary(Channel), is_binary(CKey1), is_binary(CKey2) ->
   	Cmd = [deleteGTLT, Channel, CKey1, CKey2],
  -	deleteGTLT(Cmd, create_check_channel(Channel), key_to_term(CKey1), key_to_term(CKey2)).
  +	deleteGTLT(Cmd, create_check_channel(Channel), io_key_to_term(CKey1), io_key_to_term(CKey2)).
   
   deleteGTLT(Cmd, {TN,AN}, Key1, Key2) ->
   	MatchHead = {skvhTable, '$1', '$2', '$3'},
  
positive.code: 		_ ->	binary:replace(Bin, <<13>>, <<>>, [global])
  	end.
  
  key_to_term(Key) ->
  	imem_datatype:io_to_term(Key).
  
  key_table_to_term_list(KeyTable) ->
  	BList = binary:split(clean_table(KeyTable),<<10>>,[global]),	%% split at line feed positions
  	[key_to_term(Key) || Key <- BList].
  
  kv_pair_to_tuple(KVPair) ->
  	case binary:split(KVPair,<<9>>,[global]) of						%% split at tab position
  		[K,V] -> 	{imem_datatype:io_to_term(K),V};				%% leave V as binary for now
  		_ ->		?ClientError(?E102)
  	end.
  
  kv_table_to_tuple_list(KVTable) ->
  	BList = binary:split(clean_table(KVTable),<<10>>,[global]),		%% split at line feed positions
  	[kv_pair_to_tuple(KVbin) || KVbin <- BList].
  
  read(Channel, KeyTable) when is_binary(Channel), is_binary(KeyTable) ->
  	Cmd = [read,Channel,KeyTable],
  	read(Cmd, create_check_channel(Channel), key_table_to_term_list(KeyTable), []).
  
  read(Cmd, _, [], Acc)  -> return_list(Cmd, lists:reverse(Acc));
  read(Cmd, {TN,AN}, [Key|Keys], Acc)  ->
  	KVP = case imem_meta:read(TN,Key) of
  		[] ->								list_to_binary(io_lib:format("~p\tundefined",[Key]));
  		[#skvhTable{ckey=K,cvalue=V}] ->	list_to_binary(io_lib:format("~p\t~s",[K,V]))
  	end,
  	read(Cmd, {TN,AN}, Keys, [KVP|Acc]).
  	
  
  write(Channel, KVTable) when is_binary(Channel), is_binary(KVTable) ->
  	Cmd = [write,Channel,KVTable],
  	write(Cmd, create_check_channel(Channel), kv_table_to_tuple_list(KVTable), []).
  
  write(Cmd, _, [], Acc)  -> return_list(Cmd, lists:reverse(Acc));
  write(Cmd, {TN,AN}, [{K,V}|KVPairs], Acc)  ->
  	Hash = erlang:phash2({K,V}),
  	imem_meta:write(TN,#skvhTable{ckey=K,cvalue=V,chash=Hash}),			%% ToDo: wrap in transaction
  	imem_meta:write(AN,#skvhAudit{time=erlang:now(),ckey=K,cvalue=V}),	%% ToDo: wrap in transaction
  	write(Cmd, {TN,AN}, KVPairs, [Hash|Acc]).
  
  readGELT(Channel, Item, CKey1, CKey2) ->
  	Cmd = [readGELT, Channel, Item, CKey1, CKey2],
  	readGELT(Cmd, create_check_channel(Channel), key_to_term(CKey1), key_to_term(CKey2)).
  
  readGELT(Cmd, {TN,AN}, Item, Key1, Key2) ->
  	MatchHead = {skvhTable, '$1', '$2', '$3'},
  	MatchFunction = {MatchHead, [{'>=', '$1', Key1}, {'<', '$1', Key2}], ['$1']},
  	{L,true} = imem_meta:select(TN, [MatchFunction]),
  	project(Cmd, L, Item, []).
  
  deleteGELT(Cmd, {TN,AN}, Key1, Key2) ->
  	MatchHead = {skvhTable, '$1', '$2', '$3'},
  
negative.code: 
          ?assertEqual({ok,[KVc,KVb,KVa]}, read(Channel, <<"[1,c]",13,10,"[1,b]",10,"[1,a]">>)),
  
          ?assertEqual({ok,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, delete(Channel, <<"[1,a]",10,"[1,b]",13,10,"[1,c]",10>>)),
  
          ?assertEqual({ok,[<<"[1,a]",9,"undefined">>]}, read(Channel, <<"[1,a]">>)),
          ?assertEqual({ok,[<<"[1,b]",9,"undefined">>]}, read(Channel, <<"[1,b]">>)),
          ?assertEqual({ok,[<<"[1,c]",9,"undefined">>]}, read(Channel, <<"[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,[]},deleteGELT(Channel, <<"[]">>, <<"[]">>)),
  		?assertEqual({ok,[]},deleteGELT(Channel, <<"[]">>, <<"[1,a]">>)),
  
  		?assertEqual({ok,[<<"1296644">>]},deleteGELT(Channel, <<"[]">>, <<"[1,ab]">>)),
  		?assertEqual({ok,[]},deleteGELT(Channel, <<"[]">>, <<"[1,ab]">>)),
  
  		?assertEqual({ok,[<<"124793159">>,<<"117221887">>]},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,[<<"1296644">>,<<"124793159">>,<<"117221887">>]}, 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,[]},deleteGTLT(Channel, <<"[]">>, <<"[1,ab]">>)),
  
  		?assertEqual({ok,[<<"117221887">>]},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,[]},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,[<<"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, imem_meta:drop_table(skvhTEST)),
          ?assertEqual(ok, imem_meta:drop_table(skvhAuditTEST_86400@)),
  