anchor.diff:  remove_field_names([_Name,Type|T],Acc,[F|FieldTypes]) -> 
   	remove_field_names(T,[decode_field_type(Type,F)|Acc],FieldTypes).
   
  -%% Todo: Decode field type is the place we will work out how to deserialise things into something other than strings in the future.
  -%% We should be able to return atoms and terms to!
  -%% TODO: not sure why the binary is needed here. It seems to die on read_many if I don't catch an empty binary here.
   decode_field_type(<<>>,_) -> 
   	<<>>;
   decode_field_type(Field,{Type,_}) -> 
  
positive.code: 	timer:sleep(Wait).
  
  %% Return: {write,Lease time in ms}
  write(State,Type_name, Template, Lease) ->
  	case lists:keysearch(Type_name, 1,State#state.type_structures) of
  		false -> {fail, missing_type};
  		{value,{_,Type_channel,_,_}} ->
  			ID_entry = create_id_object(create_Zn_entry(Template)),
  			Header = <<16#FAB20003:?ZnInt>>,
  			Timeout = 1000,
  		    ok = gen_tcp:send(State#state.socket, <<Header/binary,Type_channel:?ZnInt, ID_entry/binary,Lease:?ZnLong>>),
  %%io:format("~p ~p\n",["Written",ID_entry]),
  			{ok,<<Lease_granted:?ZnLong>>} = gen_tcp:recv(State#state.socket,0,Timeout),
  			{write,Lease_granted}
  	end.
  
  %% Return: {read_many,number of matches,list of entries - could be empty}
  read_many(State,Type_name, Template, Limit) ->
  	case lists:keysearch(Type_name, 1,State#state.type_structures) of
  		false -> {fail, missing_type};
  		{value,{_,Type_channel,_,Field_info}} ->
  			Template_entry = create_Zn_entry(Template),
  
negative.code: 	FI_Length = length(FieldInfo),
  	FI_fun = fun({FieldType,FieldName},Binary) -> TypeString = create_Zn_string(FieldType),
  												  NameString = create_Zn_string(FieldName),
  												  <<Binary/binary,TypeString/binary,NameString/binary>> end,
  	FI_binaries = lists:foldl(FI_fun,<<FI_Length:?ZnInt>>,FieldInfo),
  	<<Typename_bin/binary,0:?ZnInt,FI_binaries/binary>>.
  
  