diff --git a/Data/Simtreelo.hs b/Data/Simtreelo.hs
--- a/Data/Simtreelo.hs
+++ b/Data/Simtreelo.hs
@@ -36,9 +36,38 @@
 >    Edward
 
 -}
-module Data.Simtreelo(loadString, loadFile) where
+module Data.Simtreelo(loadString, loadFile, write, toString, merge) where
 
 import Data.Tree
+
+-- | Merges a tree into a forest, using available nodes when possible.
+--
+-- | Every node must have a unique label
+merge [] tree = [ tree ]
+merge (fh:fr) tree
+  | rootLabel fh == rootLabel tree = Node{rootLabel = rootLabel tree, subForest = mergeForest (subForest fh) (subForest tree)} : fr
+  | otherwise = fh : merge fr tree
+
+-- | Merges two forests into one, joining duplicate nodes when possible
+--
+-- | Every node must have a unique label
+
+mergeForest fa fb = foldl merge fa fb
+
+
+-- | Writes a forest into a file using the Simtreelo format
+write forest comment indent file =
+  let contents = comment ++ "\n" ++ toString forest indent in
+  writeFile file contents
+
+-- | Transforms the forest into a string with the Simtreelo format
+toString forest indent = concat $ map ( toString' indent 0) forest
+toString' indent depth tree =
+  indentation ++ (rootLabel tree) ++ "\n" ++ children
+  where
+    indentation = concat $ take depth $ repeat indent
+    children = concat $ map (toString' indent (depth + 1) ) $ subForest tree
+  
 
 -- | The input 'String' must be organized in such a way that every child is one indentation lower than its parent, and all siblings have the same indentation.
 --
diff --git a/simtreelo.cabal b/simtreelo.cabal
--- a/simtreelo.cabal
+++ b/simtreelo.cabal
@@ -10,7 +10,7 @@
 -- PVP summary:      +-+------- breaking API changes
 --                   | | +----- non-breaking API additions
 --                   | | | +--- code changes with no API change
-version:             0.1.0.3
+version:             0.1.1.0
 
 -- A short (one-line) description of the package.
 synopsis:            Loader for data organized in a tree
