apply (Leaf x) (os:h:oss) =  (ap:h):oss
  where ap = if null os then Atom x else List (Atom x:reverse os)
apply (Leaf x) (os:h:oss) =  (ap:h):oss
  where ap = if null os then Atom x else List (Atom x:reverse os)
apply (Leaf x) (os:h:oss) =  (ap:h):oss
  where ap = if null os then Atom x else List (Atom x:reverse os)