    with the new-parent-id. Additionally the relative position of
    the newly added morph is being adopted, so that it does not
    change position. This is a semantic expectation from a morphic move."
-  (prn "moving " id " to ->" new-parent-id)
   (if (not= id new-parent-id)
-    (let [[self props submorphs] (find-morph world-state id)
+    (let [moved-morph (fetch world-state ($morph id))
           {gpx :x gpy :y} (position-in-world world-state new-parent-id)
           global-pos (position-in-world world-state id)
-          relative-pos (add-points global-pos {:x (- gpx) :y (- gpy)})] 
-      (prn "relative-pos " relative-pos)
-      (prn "global-pos " global-pos)
+          relative-pos (add-points global-pos {:x (- gpx) :y (- gpy)})]
       (-> world-state
         (without id)
-        (redefine new-parent-id (fn [new-owner now-props now-submorphs]
-                                  (new-owner now-props
-                                             now-submorphs 
-                                             ; we also need to adapt the position
-                                             ; which is now relative to the new owner
-                                             (self (assoc props :position relative-pos) submorphs))))))
+        (add-morph new-parent-id moved-morph)
+        (set-prop id :position relative-pos)))
     world-state))
 
 (defn morph-under-me 

(defn render-placeholder [morph]
  nil) ; render nothing. Its fine.

(defn render [expr]
  (if-not (morph? expr)
    (when (expanded-expression? expr)
      (let [morph (:expanded-expression (meta expr))] 
        (if (morph? morph)
          (render morph)
          (apply dom/div nil (map render morph)))))
    (if (not-yet-compiled? expr)
      ; we encountered an expression that is not yet ready for rendering
      (render-placeholder expr)
      ; we have to branch into the expressions meta-data to continue rendering
      (let [[self props & args] expr
            props (merge props @(:compiled-props (meta expr)))] 
          (match [self props args]
               ['rectangle {:id id} submorphs] (om/build render-rectangle [props submorphs] {:react-key id})
               ['ellipse {:id id} submorphs] (om/build render-ellipse [props submorphs] {:react-key id})

(defn get-plain-css [value]
  value)

(defn get-transform-css [{rotation :rotation, scale :scale, pivot :pivot-point, 
                          :or {rotation 0, scale 1, pivot {:x 0, :y 0}}}]
  {html5TransformProperty (str "rotate(" (mod (/ (* rotation 180) js/Math.PI) 360) "deg) scale(" scale "," scale ")")
   html5TransformOriginProperty (str (:x pivot) "px " (:y pivot) "px")})
