                                      (aset cur 4 nil)))
         join-itr (join-iterator #js [itr1 itr2 itr3 filter child-id-itr remove-id-itr])]
     (transform (aget env "ctx") join-itr (fn [cur remember! forget! pretend!]
-                                           (pretend! "elem-child" #js ["todo-list" (aget cur 3) -1])
+                                           (pretend! "elem-child" #js ["todo-list" (aget cur 0) (aget cur 3)])
                                            (pretend! "elem" #js [(aget cur 3) "li"])
                                            (pretend! "elem-event" #js [(aget cur 3) "onDoubleClick" (aget cur 3) nil])
-                                           (pretend! "elem-child" #js [(aget cur 3) (str (aget cur 3) "-0") 0])
+                                           (pretend! "elem-child" #js [(aget cur 3) 0 (str (aget cur 3) "-0")])
                                            (pretend! "elem-text" #js [(str (aget cur 3) "-0") (aget cur 1)])
-                                           (pretend! "elem-child" #js [(aget cur 3) (aget cur 4) 1])
+                                           (pretend! "elem-child" #js [(aget cur 3) 1 (aget cur 4)])
                                            (pretend! "elem" #js [(aget cur 4) "button"])
-                                           (pretend! "elem-child" #js [(aget cur 4) (str (aget cur 4) "-0") 0])
+                                           (pretend! "elem-child" #js [(aget cur 4) 0 (str (aget cur 4) "-0")])
                                            (pretend! "elem-text" #js [(str (aget cur 4) "-0") "x"])
                                            (pretend! "elem-event" #js [(aget cur 4) "onClick" nil nil])
                                            ))))

    (transform (aget env "ctx") join-itr (fn [cur remember! forget! pretend!]
                                           (pretend! "elem" #js ["app" "div"])

                                           (pretend! "elem-child" #js ["app" "todo-header" 0])
                                           (pretend! "elem" #js ["todo-header" "h1"])
                                           (pretend! "elem-child" #js ["todo-header" "todo-header-0" 0])
                                           (pretend! "elem-text" #js ["todo-header-0" "Todos"])

                                           (pretend! "elem-child" #js ["app" "toggle-all" 1])
                                           (pretend! "elem" #js ["toggle-all" "input"])
                                           (pretend! "elem-attr" #js ["toggle-all" "type" "checkbox"])
                                           (pretend! "elem-attr" #js ["toggle-all" "checked" (aget cur 0)])
                                           (pretend! "elem-event" #js ["toggle-all" "onChange" nil nil])
                                           (pretend! "elem-event" #js ["toggle-all" "onKeyDown" nil nil])

                                           (pretend! "elem-child" #js ["app" "add-todo" 2])
                                           (pretend! "elem" #js ["add-todo" "button"])
                                           (pretend! "elem-event" #js ["add-todo" "onClick" "add-todo" nil])
                                           (pretend! "elem-child" #js ["add-todo" "add-todo-0" 0])
                                           (pretend! "elem-text" #js ["add-todo-0" "add"])

                                           (pretend! "elem-child" #js ["app" "todo-list" 3])
                                           (pretend! "elem" #js ["todo-list" "ul"])


                                           (pretend! "elem-child" #js ["app" "filter-all" 4])
                                           (pretend! "elem" #js ["filter-all" "button"])
                                           (pretend! "elem-event" #js ["filter-all" "onClick" "filter-all" nil])
                                           (pretend! "elem-child" #js ["filter-all" "filter-all-0" 0])
                                           (pretend! "elem-text" #js ["filter-all-0" "all"])

                                           (pretend! "elem-child" #js ["app" "filter-active" 4])
                                           (pretend! "elem" #js ["filter-active" "button"])
                                           (pretend! "elem-event" #js ["filter-active" "onClick" "filter-active" nil])
                                           (pretend! "elem-child" #js ["filter-active" "filter-active-0" 0])
                                           (pretend! "elem-text" #js ["filter-active-0" "active"])

                                           (pretend! "elem-child" #js ["app" "filter-completed" 4])
                                           (pretend! "elem" #js ["filter-completed" "button"])
                                           (pretend! "elem-event" #js ["filter-completed" "onClick" "filter-completed" nil])
                                           (pretend! "elem-child" #js ["filter-completed" "filter-completed-0" 0])
                                           (pretend! "elem-text" #js ["filter-completed-0" "completed"])

                                           ))))

    (while (.key all-children)
      (let [cur (.key all-children)
            parent (aget cur 0)
            child (aget cur 2)
            pos (aget cur 1)
            parent-el (aget built-els parent)
            child-el (aget built-els child)]
        (.push (.-props.children parent-el) child-el)
