   defp dict_put(trie(root: root, depth: depth, size: size, expand_on: size, contract_on: contract_on) = dict, key, value) do
     root = node_expand(root, depth, depth + 1)
     dict = trie(dict, root: root, depth: depth + 1,
-      expand_on: size * @node_size, contract_on: contract_on * @node_size)
+      expand_on: size * unquote(node_size), contract_on: contract_on * unquote(node_size))
     dict_put(dict, key, value)
   end
 

  end

  defp node_fold(node, depth, acc, fun, count) when count >= 1 do
    acc = node_fold(:erlang.element(count, node), depth - 1, acc, fun, @node_size)
    node_fold(node, depth, acc, fun, count - 1)
  end


  end

  defp node_contract({ b1, b2, b3, b4, b5, b6, b7, b8 }, 1, n) do
    unquote(node_escaped)
      |> each_contract(b1, n) |> each_contract(b2, n) |> each_contract(b3, n)
      |> each_contract(b4, n) |> each_contract(b5, n) |> each_contract(b6, n)
      |> each_contract(b7, n) |> each_contract(b8, n)
  end

  defp each_contract(acc, { b1, b2, b3, b4, b5, b6, b7, b8 }, n) do
    acc
      |> node_relocate(b1, n) |> node_relocate(b2, n) |> node_relocate(b3, n)
      |> node_relocate(b4, n) |> node_relocate(b5, n) |> node_relocate(b6, n)
      |> node_relocate(b7, n) |> node_relocate(b8, n)
  end

  defp node_relocate(node // unquote(node_escaped), bucket, n) do
    :lists.foldl fn { key, value }, acc ->
      pos = key |> bucket_hash() |> bucket_nth_index(n)
      setelem(acc, pos, bucket_put!(elem(acc, pos), key, value))
