collectLeaves (Split ch _ _)   =
  let children =
        catMaybes $ map (\x -> do y <- nodeContent x
                                  return (y,y))
                        ch
  in
  let deeperLeaves = concatMap collectLeaves ch in
  children ++ deeperLeaves
collectLeaves (Split ch _ _)   =
  let children =
        catMaybes $ map (\x -> do y <- nodeContent x
                                  return (y,y))
                        ch
  in
  let deeperLeaves = concatMap collectLeaves ch in
  children ++ deeperLeaves
collectLeaves (Split ch _ _)   =
  let children =
        catMaybes $ map (\x -> do y <- nodeContent x
                                  return (y,y))
                        ch
  in
  let deeperLeaves = concatMap collectLeaves ch in
  children ++ deeperLeaves