anchor.diff:      ?debugVal(ResultPos2_1),
       {ok, Lookup2_1} = vtree:lookup(Fd2, ResultPos2_1, {0,0,1001,1001}),
       ?assertEqual(92, length(Lookup2_1)),
  +
  +    % Test 3.3: input tree is too small (1 level) and procudes split
  +    % (seedtree height=1)
  +    TargetTreeNodeNum3 = 64,
  +    TargetTreeHeight3 = log_n_ceil(?MAX_FILLED, TargetTreeNodeNum3),
  +    {Nodes3, Fd3, RootPos3} = create_random_nodes_and_packed_tree(
  +        4, TargetTreeNodeNum3, ?MAX_FILLED),
  +
  +    Seedtree3_1 = seedtree_init(Fd3, RootPos3, 1),
  +    ?debugVal(Seedtree3_1),
  +    Seedtree3_2 = seedtree_insert_list(Seedtree3_1, Nodes3),
  +    {ok, ResultPos3} = seedtree_write(Fd3, Seedtree3_2, TargetTreeHeight3),
  +    ?debugVal(RootPos3),
  +    ?debugVal(ResultPos3),
  +    {ok, Lookup3} = vtree:lookup(Fd3, ResultPos3, {0,0,1001,1001}),
  +    ?assertEqual(114, length(Lookup3)),
   ok.
  +seedtree_write_case3_test() ->
  +
  +    % Test 4.4: input tree is too small (1 level) and produces multiple
  +    % splits (recusively) (seedtree height=2)
  +    % XXX vmx: not really sure if there's more than one split
  +    TargetTreeNodeNum4 = 196,
  +    TargetTreeHeight4 = log_n_ceil(4, TargetTreeNodeNum4),
  +    ?debugVal(TargetTreeHeight4),
  +    {Nodes4, Fd4, RootPos4} = create_random_nodes_and_packed_tree(
  +        4, TargetTreeNodeNum4, 4),
  +    Seedtree4_1 = seedtree_init(Fd4, RootPos4, 2),
  +    ?debugVal(Seedtree4_1),
  +    Seedtree4_2 = seedtree_insert_list(Seedtree4_1, Nodes4),
  +    {ok, ResultPos4} = seedtree_write(Fd4, Seedtree4_2, TargetTreeHeight4),
  +    ?debugVal(RootPos4),
  +    ?debugVal(ResultPos4),
  +
  +    % Several parents => create new root node
  +    ResultNodes4 = [{Mbr, #node{type=inner}, Pos} || {Mbr, Pos} <- ResultPos4],
  +    Mbr4 = vtree:calc_nodes_mbr(ResultNodes4),
  +    ChildrenPos4 = write_nodes(Fd4, ResultNodes4),
  +    {ok, ResultPos4_2} = couch_file:append_term(
  +         Fd4, {Mbr4, #node{type=inner}, ChildrenPos4}),
  +    ?debugVal(ResultPos4_2),
  +
  +    {ok, Lookup4} = vtree:lookup(Fd4, ResultPos4_2, {0,0,1001,1001}),
  +    ?assertEqual(200, length(Lookup4)),
  +    LeafDepths4 = vtreestats:leaf_depths(Fd4, ResultPos4_2),
  +    ?assertEqual([4], LeafDepths4),
  +ok.
  +seedtree_write_case3_test_foo() ->
  +    % Test 3.5: input tree is too small (2 levels) and produces multiple
  +    % splits (recusively) (seedtree height=2)
  +    % XXX vmx: not really sure if there's more than one split
  +    TargetTreeNodeNum5 = 196,
  +    TargetTreeHeight5 = log_n_ceil(4, TargetTreeNodeNum5),
  +    ?debugVal(TargetTreeHeight5),
  +    {Nodes5, Fd5, RootPos5} = create_random_nodes_and_packed_tree(
  +        4, TargetTreeNodeNum5, 4),
  +    Seedtree5_1 = seedtree_init(Fd5, RootPos5, 2),
  +    ?debugVal(Seedtree5_1),
  +    Seedtree5_2 = seedtree_insert_list(Seedtree5_1, Nodes5),
  +    {ok, ResultPos5} = seedtree_write(Fd5, Seedtree5_2, TargetTreeHeight5),
  +    ?debugVal(ResultPos5),
  +    {ok, Lookup5} = vtree:lookup(Fd5, ResultPos5, {0,0,1001,1001}),
  +    ?assertEqual(296, length(Lookup5)).
  +
   
   % @doc Loads nodes from file
   -spec load_nodes(Fd::file:io_device(), Positions::[integer()]) -> list().
  
positive.code:     {ok, Lookup5} = vtree:lookup(Fd5, ResultPos5, {0,0,1001,1001}),
      ?assertEqual(296, length(Lookup5)).
  
  seedtree_write_case3_test() ->
      % Test "Case 3: input R-tree is shorter than the level of the child level of the target node" (chapter 6.3)
      % Test 3.1: input tree is too small (1 level)
      TargetTreeNodeNum = 25,
  
negative.code:         %    false -> #node{type=inner}
          %end,
          Meta = #node{type=inner},
          {ok, Pos} = couch_file:append_term(Fd, {Mbr, Meta, Children}),
          {ok, [{Mbr, Pos}|Acc]}
      end,
      {_, Acc3} = omt_write_tree(Fd, T, Depth, Acc2),
  