diff --git a/GL.hs b/GL.hs
new file mode 100644
--- /dev/null
+++ b/GL.hs
@@ -0,0 +1,60 @@
+{-# LANGUAGE UnicodeSyntax #-}
+module GL () where
+
+import Graph
+import GraphRewriting.Layout.PortSpec
+import qualified Graphics.UI.GLUT as GL
+import GraphRewriting.GL.Render
+
+
+instance PortSpec Vertex where
+	portSpec node = let sd = sameDir in case node of
+		Applicator {} → [sd n, sd (sw*0.7), sd (se*0.7)]
+		Combinator {} → [sd n]
+		Duplicator {} → [sd nw, sd ne, sd s]
+		Variable   {} → [sd n]
+		Eraser     {} → [sd s]
+		Root       {} → [sd s]
+		where
+			n = Vector2 0 1
+			w = Vector2 (-1) 0
+			e = Vector2 1 0
+			s = Vector2 0 (-1)
+			sw = Vector2 (-1) (-1)
+			se = Vector2 1 (-1)
+			nw = Vector2 (-1) 1
+			ne = Vector2 1 1
+
+instance Render Vertex where render = renderNode
+
+renderNode Root {} = return ()
+renderNode node = drawPorts node >> case node of
+	Applicator {} → drawNode "A"
+	Combinator {} → drawNode $ show $ combinator node
+	Duplicator {} → GL.preservingMatrix $ GL.renderPrimitive GL.LineLoop $ do
+		vertex2 (0,-1)
+		vertex2 (-1,1)
+		vertex2 (1,1)
+	Variable   {} → drawNode $ variable node
+	Eraser     {} → drawNode ""
+
+drawPorts ∷ Vertex -> IO ()
+drawPorts = mapM_ drawPort . relPortPos
+
+circle r1 r2 step = mapM_ vertex2 vs where
+	is = take (truncate step + 1) [0, i' .. ]
+	i' = 2 * pi / step
+	vs = [ (r1 * cos i, r2 * sin i) | i <- is ]
+
+drawPort pos = GL.preservingMatrix $ do
+	GL.translate $ vector pos
+	GL.renderPrimitive GL.Polygon (circle 0.15 0.15 10)
+
+drawNode label = do
+	GL.renderPrimitive GL.LineLoop (circle 1 1 20)
+	drawString label
+
+drawString label = GL.preservingMatrix $ do
+	GL.translate $ vector2 (-0.3,-0.3)
+	GL.scale 0.0065 0.0065 (0 ∷ GL.GLdouble)
+	GL.renderString GL.MonoRoman label
diff --git a/Graph.hs b/Graph.hs
new file mode 100644
--- /dev/null
+++ b/Graph.hs
@@ -0,0 +1,55 @@
+{-# LANGUAGE UnicodeSyntax, FlexibleInstances, MultiParamTypeClasses #-}
+module Graph where
+
+import Data.View
+import GraphRewriting.Graph
+import GraphRewriting.Graph.Write
+import qualified Term
+import Data.Maybe (listToMaybe)
+
+data Combinator = S | K | I | B | C | S' | B' | C' | W deriving (Show,Read,Eq)
+
+data Vertex
+	= Applicator {inp, out1, out2 ∷ Port}
+	| Combinator {inp ∷ Port, combinator ∷ Combinator}
+	| Duplicator {inp1, inp2, out ∷ Port}
+	| Variable   {inp ∷ Port, variable ∷ String}
+	| Eraser     {out ∷ Port}
+	| Root       {out ∷ Port}
+
+instance View [Port] Vertex where
+	inspect node = case node of
+		Applicator {inp = i, out1 = o1, out2 = o2} → [i,o1,o2]
+		Combinator {inp = i}                       → [i]
+		Duplicator {inp1 = i1, inp2 = i2, out = o} → [i1,i2,o]
+		Variable   {inp = i}                       → [i]
+		Eraser     {out = o}                       → [o]
+		Root       {out = o}                       → [o]
+	update ports node = case node of
+		Applicator {} → node {inp = i, out1 = o1, out2 = o2} where [i,o1,o2] = ports
+		Combinator {} → node {inp = i}                       where [i]       = ports
+		Duplicator {} → node {inp1 = i1, inp2 = i2, out = o} where [i1,i2,o] = ports
+		Variable   {} → node {inp = i}                       where [i]       = ports
+		Eraser     {} → node {out = o}                       where [o]       = ports
+		Root       {} → node {out = o}                       where [o]       = ports
+
+fromTerm ∷ Term.Expr → Graph Vertex
+fromTerm term = flip execGraph emptyGraph $ do
+	e ← compile term
+	newNode Root {out = e}
+
+compile ∷ Term.Expr → Rewrite Vertex Edge
+compile term = do
+	e ← newEdge
+	case term of
+		Term.Application f x → do
+			ef ← compile f
+			ex ← compile x
+			newNode Applicator {inp = e, out1 = ef, out2 = ex}
+		Term.Variable v → case maybeRead v of
+			Just c  → newNode Combinator {inp = e, combinator = c}
+			Nothing → newNode Variable   {inp = e, variable   = v}
+	return e
+
+maybeRead :: Read a => String -> Maybe a
+maybeRead = fmap fst . listToMaybe . reads
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,10 @@
+Copyright (c) 2010, Jan Rochel
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+* Neither the name of the University of Utrecht nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Main.hs b/Main.hs
new file mode 100644
--- /dev/null
+++ b/Main.hs
@@ -0,0 +1,64 @@
+{-# LANGUAGE UnicodeSyntax, FlexibleInstances #-}
+module Main where
+
+import GraphRewriting.GL.Render
+import GraphRewriting.GL.UI as UI
+import Term (parseFile)
+import Graph
+import GL ()
+import Rules
+import GraphRewriting
+import GraphRewriting.Graph.Write.Unsafe as Unsafe
+import GraphRewriting.Layout.Coulomb
+import GraphRewriting.Layout.SpringEmbedder
+import GraphRewriting.Layout.Gravitation
+import GraphRewriting.Layout.Wrapper
+
+
+instance Render (Wrapper Vertex) where render = render . wrappee
+
+main ∷ IO ()
+main = do
+	(prog,args) ← UI.initialise
+	file ← case args of
+		[f] → return f
+		___ → error "usage: comb [GLUT-options] <file>"
+	term ← parseFile file
+	let graph = fromTerm term
+	UI.run 40 id layoutStep (wrapGraph graph) ruleTree 
+
+layoutStep n = do
+	(cgf, cf, sf, rot) ← readOnly $ do
+		cgf ← centralGravitation n
+		cf ← coulombForce n
+		sf ← springForce 1.5 n
+		rot ← angularMomentum n
+		return (cgf, cf, sf, rot)
+	Unsafe.adjustNode (Position . sf (*0.9) . cgf (*0.01) . cf (\x → min (100/(x^2+0.1)) 10) . position) n
+	-- Unsafe.adjustNode (rot (*0.9)) n
+
+-- anyRule = anyOf [ eliminate, ruleI, ruleK0, ruleK1, ruleS0, ruleS1, ruleS2, ruleE0, ruleE1, ruleE2, ruleD0, ruleD1, ruleD2]
+
+ruleTree = Branch "All"
+--	[Branch "Optimisation"
+--	 	[Leaf "S(Kx)(Ky) -> K(xy)" optimStoK,
+--	 	 Leaf "S(Kx)I    -> x"     optimStox,
+--	 	 Leaf "S(Kx)y    -> Bxy"   optimStoB,
+--	 	 Leaf "Sx(Ky)    -> Cxy"   optimStoC,
+--	 	 Leaf "S(Bkx)y   -> S'kxy" optimStoS',
+--	 	 Leaf "B(kx)y    -> B'kxy" optimBtoB',
+--	 	 Leaf "C(Bkx)y   -> C'kxy" optimCtoC'],
+	[Branch "General"
+	 	[Leaf "Eliminate" eliminate,
+	 	 Leaf "Erase" (erase0 <|> eraseApplicator),
+	 	 Leaf "Duplicate" duplicate],
+	 Branch "Combinators"
+	 	[Leaf "S" combinatorS,
+	 	 Leaf "K" combinatorK,
+	 	 Leaf "I" combinatorI,
+	 	 Leaf "B" combinatorB,
+	 	 Leaf "C" combinatorC,
+	 	 Leaf "S'" combinatorS',
+	 	 Leaf "B'" combinatorB',
+	 	 Leaf "C'" combinatorC',
+	 	 Leaf "W" combinatorW]]
diff --git a/Rules.hs b/Rules.hs
new file mode 100644
--- /dev/null
+++ b/Rules.hs
@@ -0,0 +1,135 @@
+{-# LANGUAGE UnicodeSyntax, FlexibleContexts #-}
+module Rules where
+
+import Prelude.Unicode
+import Graph
+import GraphRewriting
+
+
+-- The set-up ----------------------------------------------------------------
+
+arity0 ∷ (View [Port] n, View Vertex n) ⇒ Edge → Pattern n Vertex
+arity0 i = anyOf [c,v,e] where
+	c = do {c@Combinator {} ← nodeAt i; return c}
+	v = do {v@Variable   {} ← nodeAt i; return v}
+	e = do {e@Eraser     {} ← nodeAt i; return e}
+
+erase0 ∷ (View [Port] n, View Vertex n) ⇒ Rule n 
+erase0 = linear $ do
+	Eraser {out = o} ← node
+	n ← arity0 o
+	erase
+
+eraseApplicator ∷ (View [Port] n, View Vertex n) ⇒ Rule n 
+eraseApplicator = linear $ do
+	Eraser {out = o} ← node
+	Applicator {inp = i, out1 = o1, out2 = o2} ← nodeAt o
+	require (o ≡ i)
+	replace0 [Node $ Eraser {out = o1}, Node $ Eraser {out = o2}]
+
+duplicate ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+duplicate = duplicateApplicator <|> do
+	Duplicator {inp1 = i1, inp2 = i2, out = o} ← node
+	n ← arity0 o
+	replace0 $ [Node $ n {inp = i1}, Node $ n {inp = i2}]
+
+duplicateApplicator ∷ (View [Port] n, View Vertex n) ⇒ Rule n 
+duplicateApplicator = do
+	Duplicator {inp1 = i1, inp2 = i2, out = o} ← node
+	Applicator {inp = i, out1 = o1, out2 = o2} ← nodeAt o
+	replace4 $ \l1 l2 x1 x2 →
+		[Node $ Applicator {inp = i1, out1 = l1, out2 = x1},
+		 Node $ Applicator {inp = i2, out1 = x2, out2 = l2},
+		 Node $ Duplicator {inp1 = l1, inp2 = x2, out = o1},
+		 Node $ Duplicator {inp1 = x1, inp2 = l2, out = o2}]
+
+eliminate ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+eliminate = do
+	Eraser {out = oE} ← node
+	Duplicator {out = oD, inp1 = i1, inp2 = i2} ← nodeAt oE
+	require (oE ≡ i1 ∨ oE ≡ i2)
+	if oE ≡ i1
+		then rewire [[oD,i2]]
+		else rewire [[oD,i1]]
+
+combinatorPattern ∷ (View [Port] n, View Vertex n) ⇒ Combinator → Int → Pattern n (Edge, [Edge])
+combinatorPattern c arity = do
+	Combinator {inp = i, combinator = c'} ← node
+	require (c ≡ c')
+	accumulateArguments i arity
+	where
+	accumulateArguments i 0 = return (i,[])
+	accumulateArguments i n = do
+		Applicator {inp = iA, out1 = o1, out2 = o2} ← nodeAt i
+		require (i ≡ o1)
+		(i',args) ← accumulateArguments iA (n-1)
+		return (i',o2:args)
+
+-- The show-down -------------------------------------------------------------
+
+combinatorS ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorS = do
+	(i, [f,g,x]) ← combinatorPattern S 3
+	replace4 $ \l lr r rr →
+		[Node $ Applicator {inp = l, out1 = f, out2 = lr},
+		 Node $ Applicator {inp = r, out1 = g, out2 = rr},
+		 Node $ Duplicator {inp1 = lr, inp2 = rr, out = x},
+		 Node $ Applicator {inp = i, out1 = l, out2 = r}]
+
+combinatorK ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorK = do
+	(i, [x,y]) ← combinatorPattern K 2
+	replace0 [Node $ Eraser {out = y}, Wire i x]
+
+combinatorI ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorI = do
+	(i, [x]) ← combinatorPattern I 1
+	rewire [[i,x]]
+
+combinatorB ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorB = do
+	(i, [x,y,z]) ← combinatorPattern B 3
+	replace1 $ \r →
+		[Node $ Applicator {inp = r, out1 = y, out2 = z},
+		 Node $ Applicator {inp = i, out1 = x, out2 = r}]
+
+combinatorC ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorC = do
+	(i, [x,y,z]) ← combinatorPattern C 3
+	replace1 $ \l →
+		[Node $ Applicator {inp = l, out1 = x, out2 = z},
+		 Node $ Applicator {inp = i, out1 = l, out2 = y}]
+
+combinatorS' ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorS' = do
+	(i, [k,x,y,z]) ← combinatorPattern S' 4
+	replace5 $ \l lr lrr r rr →
+		[Node $ Applicator {inp = lr, out1 = x, out2 = lrr},
+		 Node $ Applicator {inp = l, out1 = k, out2 = lr},
+		 Node $ Applicator {inp = r, out1 = y, out2 = rr},
+		 Node $ Duplicator {inp1 = lrr, inp2 = rr, out = z},
+		 Node $ Applicator {inp = i, out1 = l, out2 = r}]
+
+combinatorB' ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorB' = do
+	(i, [k,x,y,z]) ← combinatorPattern B' 4
+	replace2 $ \l r →
+		[Node $ Applicator {inp = l, out1 = k, out2 = x},
+		 Node $ Applicator {inp = r, out1 = y, out2 = z},
+		 Node $ Applicator {inp = i, out1 = l, out2 = r}]
+
+combinatorC' ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorC' = do
+	(i, [k,x,y,z]) ← combinatorPattern C' 4
+	replace2 $ \l lr →
+		[Node $ Applicator {inp = l, out1 = k, out2 = lr},
+		 Node $ Applicator {inp = lr, out1 = x, out2 = z},
+		 Node $ Applicator {inp = i, out1 = l, out2 = y}]
+
+combinatorW ∷ (View [Port] n, View Vertex n) ⇒ Rule n
+combinatorW = do
+	(i, [x,y]) ← combinatorPattern W 2
+	replace3 $ \l lr r →
+		[Node $ Applicator {inp = l, out1 = x, out2 = lr},
+		 Node $ Duplicator {inp1 = lr, inp2 = r, out = y},
+		 Node $ Applicator {inp = i, out1 = l, out2 = r}]
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/Term.hs b/Term.hs
new file mode 100644
--- /dev/null
+++ b/Term.hs
@@ -0,0 +1,33 @@
+{-# LANGUAGE UnicodeSyntax #-}
+module Term where
+
+import Prelude.Unicode
+import Text.ParserCombinators.Parsec as Parsec
+import Text.ParserCombinators.Parsec.Token as Parsec
+import Text.ParserCombinators.Parsec.Language as Parsec
+import Control.Monad (liftM)
+
+
+data Expr = Application Expr Expr | Variable String deriving (Ord, Eq)
+
+instance Show Expr where
+	show = showComp False where
+		showComp :: Bool → Expr → String
+		showComp isComponent expr = case expr of
+			Application (Application e1 e2) e3 → maybeWrap $ show e1 ⧺ " " ⧺ diverge e2 ⧺ " " ⧺ diverge e3
+			Application e1 e2 → maybeWrap $ diverge e1 ⧺ " " ⧺ diverge e2
+			Variable v → v
+			where
+			maybeWrap str = if isComponent then "(" ⧺ str ⧺ ")" else str
+			diverge = showComp True
+
+parse ∷ String → Expr
+parse str = either (error ∘ show) id (Parsec.parse parser "(null)" str)
+
+parseFile ∷ FilePath → IO Expr
+parseFile = liftM (either (error ∘ show) id) ∘ Parsec.parseFromFile parser
+
+parser ∷ Parser Expr
+parser = let expr = parser in liftM (foldl1 Application) $ many1 $ choice
+	[parens haskell expr,
+	 liftM Variable $ identifier haskell]
diff --git a/examples/0.cl b/examples/0.cl
new file mode 100644
--- /dev/null
+++ b/examples/0.cl
@@ -0,0 +1,1 @@
+(K I) (S B I) (S B I) I I
diff --git a/examples/1.cl b/examples/1.cl
new file mode 100644
--- /dev/null
+++ b/examples/1.cl
@@ -0,0 +1,1 @@
+I (S B I) (S B I) I I
diff --git a/examples/2.cl b/examples/2.cl
new file mode 100644
--- /dev/null
+++ b/examples/2.cl
@@ -0,0 +1,1 @@
+(S B I) (S B I) (S B I) I I
diff --git a/examples/3.cl b/examples/3.cl
new file mode 100644
--- /dev/null
+++ b/examples/3.cl
@@ -0,0 +1,1 @@
+(S B (S B I)) (S B I) (S B I) I I
diff --git a/examples/4.cl b/examples/4.cl
new file mode 100644
--- /dev/null
+++ b/examples/4.cl
@@ -0,0 +1,1 @@
+(S B (S B (S B I))) (S B I) (S B I) I I
diff --git a/examples/combinator_birds/bald_eagle.ski b/examples/combinator_birds/bald_eagle.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/bald_eagle.ski
@@ -0,0 +1,1 @@
+((S(K((S(K((S(KS))K)))((S(KS))K))))(S(K((S(K((S(KS))K)))((S(KS))K)))))
diff --git a/examples/combinator_birds/becard.ski b/examples/combinator_birds/becard.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/becard.ski
@@ -0,0 +1,1 @@
+((S(K((S(K((S(KS))K)))((S(KS))K))))((S(KS))K))
diff --git a/examples/combinator_birds/blackbird.ski b/examples/combinator_birds/blackbird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/blackbird.ski
@@ -0,0 +1,1 @@
+((S(K((S(KS))K)))((S(KS))K))
diff --git a/examples/combinator_birds/bluebird.ski b/examples/combinator_birds/bluebird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/bluebird.ski
@@ -0,0 +1,1 @@
+((S(KS))K)
diff --git a/examples/combinator_birds/bunting.ski b/examples/combinator_birds/bunting.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/bunting.ski
@@ -0,0 +1,1 @@
+((S(K((S(K((S(KS))K)))((S(KS))K))))((S(KS))K))
diff --git a/examples/combinator_birds/cardinal.ski b/examples/combinator_birds/cardinal.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/cardinal.ski
@@ -0,0 +1,1 @@
+((S((S(K((S(KS))K)))S))(KK))
diff --git a/examples/combinator_birds/cardinal_once_removed.ski b/examples/combinator_birds/cardinal_once_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/cardinal_once_removed.ski
@@ -0,0 +1,1 @@
+(S(K((S((S(K((S(KS))K)))S))(KK))))
diff --git a/examples/combinator_birds/cardinal_twice_removed.ski b/examples/combinator_birds/cardinal_twice_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/cardinal_twice_removed.ski
@@ -0,0 +1,1 @@
+(S(K(S(K((S((S(K((S(KS))K)))S))(KK))))))
diff --git a/examples/combinator_birds/converse_warbler.ski b/examples/combinator_birds/converse_warbler.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/converse_warbler.ski
@@ -0,0 +1,1 @@
+((S(K(S((S(K(S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))))K))))K)
diff --git a/examples/combinator_birds/crossed_konstant_mocker.ski b/examples/combinator_birds/crossed_konstant_mocker.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/crossed_konstant_mocker.ski
@@ -0,0 +1,1 @@
+((S(K(S(K((S((SK)K))((SK)K))))))K)
diff --git a/examples/combinator_birds/dickcissel.ski b/examples/combinator_birds/dickcissel.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/dickcissel.ski
@@ -0,0 +1,1 @@
+(S(K(S(K((S(KS))K)))))
diff --git a/examples/combinator_birds/double_mockingbird.ski b/examples/combinator_birds/double_mockingbird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/double_mockingbird.ski
@@ -0,0 +1,1 @@
+(S(K((S((SK)K))((SK)K))))
diff --git a/examples/combinator_birds/dove.ski b/examples/combinator_birds/dove.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/dove.ski
@@ -0,0 +1,1 @@
+(S(K((S(KS))K)))
diff --git a/examples/combinator_birds/dovekies.ski b/examples/combinator_birds/dovekies.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/dovekies.ski
@@ -0,0 +1,1 @@
+((S(K((S(KS))K)))(S(K((S(KS))K))))
diff --git a/examples/combinator_birds/eagle.ski b/examples/combinator_birds/eagle.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/eagle.ski
@@ -0,0 +1,1 @@
+(S(K((S(K((S(KS))K)))((S(KS))K))))
diff --git a/examples/combinator_birds/finch.ski b/examples/combinator_birds/finch.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/finch.ski
@@ -0,0 +1,1 @@
+((S(K((S((SK)K))(K((S(K(S((SK)K))))K)))))((S(K((S(K((S(KS))K)))((S(KS))K))))((S(K(S((SK)K))))K)))
diff --git a/examples/combinator_birds/finch_once_removed.ski b/examples/combinator_birds/finch_once_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/finch_once_removed.ski
@@ -0,0 +1,1 @@
+((S(K(S(K((S((S(K((S(KS))K)))S))(KK))))))((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S((S(K((S(KS))K)))S))(KK))))))
diff --git a/examples/combinator_birds/finch_twice_removed.ski b/examples/combinator_birds/finch_twice_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/finch_twice_removed.ski
@@ -0,0 +1,1 @@
+(S(K((S(K(S(K((S((S(K((S(KS))K)))S))(KK))))))((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S((S(K((S(KS))K)))S))(KK))))))))
diff --git a/examples/combinator_birds/goldfinch.ski b/examples/combinator_birds/goldfinch.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/goldfinch.ski
@@ -0,0 +1,1 @@
+((S(K((S(KS))K)))((S((S(K((S(KS))K)))S))(KK)))
diff --git a/examples/combinator_birds/hummingbird.ski b/examples/combinator_birds/hummingbird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/hummingbird.ski
@@ -0,0 +1,1 @@
+((S(K((S(K(S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))))K)))(S(K((S((S(K((S(KS))K)))S))(KK)))))
diff --git a/examples/combinator_birds/identity_bird_-_aka_idiot.ski b/examples/combinator_birds/identity_bird_-_aka_idiot.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/identity_bird_-_aka_idiot.ski
@@ -0,0 +1,1 @@
+((SK)K)
diff --git a/examples/combinator_birds/identity_bird_once_removed.ski b/examples/combinator_birds/identity_bird_once_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/identity_bird_once_removed.ski
@@ -0,0 +1,1 @@
+(S(SK))
diff --git a/examples/combinator_birds/identity_bird_twice_removed.ski b/examples/combinator_birds/identity_bird_twice_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/identity_bird_twice_removed.ski
@@ -0,0 +1,1 @@
+(S(SK))
diff --git a/examples/combinator_birds/jay.ski b/examples/combinator_birds/jay.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/jay.ski
@@ -0,0 +1,1 @@
+((S(K(S(K((S((S(K((S(KS))K)))S))(KK))))))((S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))(K((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S(K((S(KS))K)))((S(KS))K))))))))
diff --git a/examples/combinator_birds/kestrel_-_true.ski b/examples/combinator_birds/kestrel_-_true.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/kestrel_-_true.ski
@@ -0,0 +1,1 @@
+K
diff --git a/examples/combinator_birds/kite_-_false.ski b/examples/combinator_birds/kite_-_false.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/kite_-_false.ski
@@ -0,0 +1,1 @@
+(K((SK)K))
diff --git a/examples/combinator_birds/konstant_mocker.ski b/examples/combinator_birds/konstant_mocker.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/konstant_mocker.ski
@@ -0,0 +1,1 @@
+(K((S((SK)K))((SK)K)))
diff --git a/examples/combinator_birds/lark.ski b/examples/combinator_birds/lark.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/lark.ski
@@ -0,0 +1,1 @@
+((S((S(KS))K))(K((S((SK)K))((SK)K))))
diff --git a/examples/combinator_birds/mockingbird.ski b/examples/combinator_birds/mockingbird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/mockingbird.ski
@@ -0,0 +1,1 @@
+((S((SK)K))((SK)K))
diff --git a/examples/combinator_birds/omega.ski b/examples/combinator_birds/omega.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/omega.ski
@@ -0,0 +1,1 @@
+(((S((SK)K))((SK)K))((S((SK)K))((SK)K)))
diff --git a/examples/combinator_birds/owl.ski b/examples/combinator_birds/owl.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/owl.ski
@@ -0,0 +1,1 @@
+(S((SK)K))
diff --git a/examples/combinator_birds/quacky_bird.ski b/examples/combinator_birds/quacky_bird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/quacky_bird.ski
@@ -0,0 +1,1 @@
+((S(K((S((S(K((S(KS))K)))S))(KK))))((S(K(S((S(K((S((S(K((S(KS))K)))S))(KK))))((S(KS))K)))))K))
diff --git a/examples/combinator_birds/queer_bird.ski b/examples/combinator_birds/queer_bird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/queer_bird.ski
@@ -0,0 +1,1 @@
+((S(K(S((S(KS))K))))K)
diff --git a/examples/combinator_birds/quirky_bird.ski b/examples/combinator_birds/quirky_bird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/quirky_bird.ski
@@ -0,0 +1,1 @@
+(S(K((S(K(S((SK)K))))K)))
diff --git a/examples/combinator_birds/quixotic_bird.ski b/examples/combinator_birds/quixotic_bird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/quixotic_bird.ski
@@ -0,0 +1,1 @@
+((S(K((S((S(K((S(KS))K)))S))(KK))))((S(KS))K))
diff --git a/examples/combinator_birds/quizzical_bird.ski b/examples/combinator_birds/quizzical_bird.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/quizzical_bird.ski
@@ -0,0 +1,1 @@
+((S(K(S((S(K((S((S(K((S(KS))K)))S))(KK))))((S(KS))K)))))K)
diff --git a/examples/combinator_birds/robin.ski b/examples/combinator_birds/robin.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/robin.ski
@@ -0,0 +1,1 @@
+((S(K((S(KS))K)))((S(K(S((SK)K))))K))
diff --git a/examples/combinator_birds/robin_once_removed.ski b/examples/combinator_birds/robin_once_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/robin_once_removed.ski
@@ -0,0 +1,1 @@
+((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S((S(K((S(KS))K)))S))(KK)))))
diff --git a/examples/combinator_birds/robin_twice_removed.ski b/examples/combinator_birds/robin_twice_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/robin_twice_removed.ski
@@ -0,0 +1,1 @@
+(S(K((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S((S(K((S(KS))K)))S))(KK)))))))
diff --git a/examples/combinator_birds/starling.ski b/examples/combinator_birds/starling.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/starling.ski
@@ -0,0 +1,1 @@
+S
diff --git a/examples/combinator_birds/thrush.ski b/examples/combinator_birds/thrush.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/thrush.ski
@@ -0,0 +1,1 @@
+((S(K(S((SK)K))))K)
diff --git a/examples/combinator_birds/turing.ski b/examples/combinator_birds/turing.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/turing.ski
@@ -0,0 +1,1 @@
+((S(K(S((SK)K))))((S((SK)K))((SK)K)))
diff --git a/examples/combinator_birds/vireo_-_aka_pairing.ski b/examples/combinator_birds/vireo_-_aka_pairing.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/vireo_-_aka_pairing.ski
@@ -0,0 +1,1 @@
+((S(K((S((S(K((S(KS))K)))S))(KK))))((S(K(S((SK)K))))K))
diff --git a/examples/combinator_birds/vireo_once_removed.ski b/examples/combinator_birds/vireo_once_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/vireo_once_removed.ski
@@ -0,0 +1,1 @@
+((S(K((S((S(K((S(KS))K)))S))(KK))))((S(K(S(K((S((S(K((S(KS))K)))S))(KK))))))((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S((S(K((S(KS))K)))S))(KK)))))))
diff --git a/examples/combinator_birds/vireo_twice_removed.ski b/examples/combinator_birds/vireo_twice_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/vireo_twice_removed.ski
@@ -0,0 +1,1 @@
+(S(K((S(K((S((S(K((S(KS))K)))S))(KK))))((S(K(S(K((S((S(K((S(KS))K)))S))(KK))))))((S(K((S((S(K((S(KS))K)))S))(KK))))(S(K((S((S(K((S(KS))K)))S))(KK)))))))))
diff --git a/examples/combinator_birds/warbler.ski b/examples/combinator_birds/warbler.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/warbler.ski
@@ -0,0 +1,1 @@
+((S(K(S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))))K)
diff --git a/examples/combinator_birds/warbler_once_removed.ski b/examples/combinator_birds/warbler_once_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/warbler_once_removed.ski
@@ -0,0 +1,1 @@
+(S(K((S(K(S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))))K)))
diff --git a/examples/combinator_birds/warbler_twice_removed.ski b/examples/combinator_birds/warbler_twice_removed.ski
new file mode 100644
--- /dev/null
+++ b/examples/combinator_birds/warbler_twice_removed.ski
@@ -0,0 +1,1 @@
+(S(K(S(K((S(K(S((S(K((S((SK)K))((SK)K))))((S(K((S(KS))K)))((S(K(S((SK)K))))K))))))K)))))
diff --git a/examples/exp.cl b/examples/exp.cl
new file mode 100644
--- /dev/null
+++ b/examples/exp.cl
@@ -0,0 +1,6 @@
+	zero  = K I                         
+	one   = I                           
+	two   = S B I
+	three = S B (S B I)
+	four  = S B (S B (S B I))
+four (S B I) (S B I) I I
diff --git a/graph-rewriting-cl.cabal b/graph-rewriting-cl.cabal
new file mode 100644
--- /dev/null
+++ b/graph-rewriting-cl.cabal
@@ -0,0 +1,34 @@
+Name:           graph-rewriting-cl
+Version:        0.2.2
+Copyright:      (c) 2010, Jan Rochel
+License:        BSD3
+License-File:   LICENSE
+Author:         Jan Rochel
+Maintainer:     jan@rochel.info
+Homepage:       http://rochel.info/#graph-rewriting
+Stability:      beta
+Build-Type:     Simple
+Synopsis:       Interactive graph rewriting system implementing various well-known combinators
+Description:    Currently the following combinators are supported: S K I B C S' B' C' W
+Category:       Graphs, Application
+Cabal-Version:  >= 1.6
+Data-Files:     examples/*.cl examples/combinator_birds/*.ski
+
+Executable cl
+  Main-Is:        Main.hs
+  Build-Depends:
+    base >= 4 && < 4.4,
+    base-unicode-symbols >= 0.2 && < 0.3,
+    graph-rewriting >= 0.4.4 && < 0.6,
+    graph-rewriting-layout >= 0.4.1 && < 0.5,
+    graph-rewriting-gl >= 0.6 && < 0.7,
+    parsec >= 2.1 && < 2.2,
+    GLUT >= 2.2 && < 2.3,
+    OpenGL >= 2.4 && < 2.5
+  Extensions:
+    UnicodeSyntax
+    FlexibleInstances
+    FlexibleContexts
+    MultiParamTypeClasses
+  GHC-Options:    -fno-warn-duplicate-exports
+  Other-Modules:  GL Graph Rules Term
