anchor.diff:  %%            Keylist = [#keyelem{}]
   %%            Keys    = [string()]
   %%
  -%% @doc     return Keylist only containing the fields in Keys Note :
  -%%          use of atom() as keys (for well known keys) should
  -%%          improve patternmatch speed. When matching a E#keyelem.key
  -%%          against Key in the alternative solution below, it may
  -%%          also be worth using one of the OTP set modules so that
  -%%          the member check becomes O(log N) instead of O(N).
  -%% @end
  -%%--------------------------------------------------------------------
  -%% This code (untested) should do the same thing and should be less
  -%% confusing
  -%%
  -%% copy(Keylist, Names) when record(Keylist, keylist) ->
  -%%     Keys = normalize_list(Names),
  -%%     KeyElems = Keylist#keylist.list,
  -%%     Copies = [E ||
  -%% 		 %% determine if E from Keylist should be copied
  -%% 		 lists:member(E#keyelem.key, Keys),
  -%% 		 E <- KeyElems ],
  -%%     #keylist{list = Copies}.
  -%%--------------------------------------------------------------------
  -
  -%% XXX I can't quite figure out how this works - hsten
  -%% XXX but it does work ;) - ft
  -
  -copy(Keylist, Names) when is_record(Keylist, keylist), is_list(Names) ->
  +%% @doc     Copy the elements matching Keys from Keylist.
  +%% @end
  +%%--------------------------------------------------------------------
  +copy(Keylist, Names) when record(Keylist, keylist) ->
       Keys = normalize_list(Names),
  -    Func = fun(Key, _Name, _Item) ->
  -		   lists:member(Key, Keys)
  -	   end,
  -    %% filter() calls our Func on every element of Keylist. filter()
  -    %% returns all elements from Keylist where our Func returned
  -    %% 'true'. Func returns 'true' if the elements key is a member of
  -    %% Keys.
  -    filter(Func, Keylist).
  -
  -%%--------------------------------------------------------------------
  -%% @spec    (Func, Keylist) -> #keylist{}
  -%%
  -%%            Func    = fun() "fun(E) -> bool() - predicate function"
  -%%            Keylist = [#keyelem{}]
  -%%
  -%% @doc     Return all keyelem elements from Keylist, for which the
  -%%          predicate function returned 'true'.
  -%% @end
  -%%--------------------------------------------------------------------
  -filter(Func, Keylist) when is_record(Keylist, keylist) ->
  -    Pred = fun(Elem) ->
  -		   Func(Elem#keyelem.key, Elem#keyelem.name, Elem#keyelem.item)
  -	   end,
  -    NewL = lists:filter(Pred, Keylist#keylist.list),
  -    #keylist{list=NewL}.
  +    KeyElems = Keylist#keylist.list,
  +    Copies = [E || E <- KeyElems, lists:member(E#keyelem.key, Keys)],
  +    #keylist{list = Copies}.
   
   %%--------------------------------------------------------------------
   %% @spec    (Func, Keylist) -> [term()]
   %%
  -%%            Func    = fun() "fun(Key, Name, Item) -> term()"
  +%%            Func    = fun() "fun(Key, Name, Value) -> term()"
   %%            Keylist = #keylist{}
   %%
  -%% @doc     apply Func to all elements in Keylist (#keylist.list)
  +%% @doc     Apply Func to all elements in Keylist. Func must be of
  +%%          arity three, and accept arguments Func(Key, Name, Value)
  +%%          where Key is an atom() or a string(), Name is always a
  +%%          string() and Value is [string()].
   %% @end
   %%--------------------------------------------------------------------
   map(Func, Keylist) when is_record(Keylist, keylist) ->
       F = fun(Elem) ->
  -		Func(Elem#keyelem.key, Elem#keyelem.name, Elem#keyelem.item)
  +		Func(Elem#keyelem.key, Elem#keyelem.name, Elem#keyelem.value)
   	end,
       lists:map(F, Keylist#keylist.list).
   
  
positive.code: 
      autotest:mark(?LINE, "delete/2 - 2"),
      %% check results
      #keylist{list=[
  		   #keyelem{key="header", name="Header", item=["zero", "one"]},
  		   #keyelem{key=via, name="Via", item=["bar"]}
  		  ]} = DeleteH2,
  
      autotest:mark(?LINE, "delete/2 - 2"),
      %% delete both the 'via' and "header" elements, leaving an empty list
      #keylist{list=[]} = delete("header", delete(via, DeleteH2)),
  
      %% deletefirstvalue/2
      %%--------------------------------------------------------------------
      autotest:mark(?LINE, "deletefirstvalue/2 - 1"),
      DFVH1 = from_list([{via, "Via", ["one", "two", "three"]},
  
negative.code: 
      autotest:mark(?LINE, "appendlist/2 - 4"),
      %% check result
      [{"other", "Other", ["X"]},
       {'via', "ViA", ["one", "two", "three"]}
      ] = test_to_list(AppendLH2),
  
  
      %% map(Func, Keylist)
      %%--------------------------------------------------------------------
      autotest:mark(?LINE, "map/2 - 1"),
      CheckFun = fun(Key, Name, Value) ->
  		       case {Key, Name, Value} of
  			   {one, "one", ["one"]} -> ok;
  			   {two, "TWO", ["TWO"]} -> ok
  		       end
  