anchor.diff:  	    unpack_map_(Payload, Len, dict:new());
   
   	_Other ->
  -%	    erlang:display(_Other),
   	    {error, no_code_matches}
       end.
   
  
positive.code:     end.
  
  % FIXME: write test for pack_map/1
  pack_map({dict,M})->
      MaxLen = 16#10000, %65536
      case dict:size(M) of
  	Len when Len < 16 ->
   	    << 2#1001:4, Len:4/integer-unit:1, (pack_map_(dict:to_list(M))) >>;
  	Len when Len < MaxLen ->
  	    << 16#DE:8, Len:16/big-unsigned-integer-unit:1, (pack_map_(dict:to_list(M))) >>;
  	Len ->
  	    << 16#DF:8, Len:32/big-unsigned-integer-unit:1, (pack_map_(dict:to_list(M))) >>
      end.
  
  pack_map_([])-> <<>>;
  pack_map_([{Key,Value}|Tail]) ->
      << (pack(Key)),(pack(Value)),(pack_map_(Tail)) >>.
  
  % FIXME: write test for unpack_map/1
  -spec unpack_map_(binary(), non_neg_integer(), [{term(), msgpack_term()}])->
      {more, non_neg_integer()} | { any(), binary()}.
  unpack_map_(Bin,  0,  Dict) when is_binary(Bin) -> { {dict, Dict}, Bin};
  unpack_map_(Bin, Len, Dict) when is_binary(Bin) and is_integer(Len) ->
      case unpack(Bin) of
  	{ more, MoreLen } -> { more, MoreLen+Len-1 };
  
negative.code:     pack_raw(Bin);
  pack(List)  when is_list(List) ->
      pack_array(List);
  pack(Map) when is_tuple(Map), element(1,Map)=:=dict ->
      pack_map(Map);
  pack(_O) ->
      {error, undefined}.
  
  % unpacking.
  % if failed in decoding and not end, get more data
  