diff --git a/Emping.cabal b/Emping.cabal
--- a/Emping.cabal
+++ b/Emping.cabal
@@ -1,33 +1,38 @@
 name:                Emping
-version:             0.3
+version:             0.3.1
 license:             GPL
 license-file:        LICENSE
 build-depends:       base, parsec
 copyright:           Hans van Thiel 2006 - 2007
 author:              Hans van Thiel
 maintainer:          hthiel.char@zonnet.nl
+build-depends:       containers, array, mtl
+build-type:          Simple
+
 stability:           experimental
-homepage:            j-van-thiel.speedlinq.nl/
+homepage:            http://j-van-thiel.speedlinq.nl/
 synopsis:            derives heuristic rules from nominal data
 description:         utility that reads a table in a csv (comma
-       separated) format that can be generated from 
-       Open Office Calc (spreadsheet), derives all shortest rules
-       for a selected attribute, and writes them to a .csv file
-       that can be read by OO Calc. The shortest rules may be
-       partially ordered by implication (entailment) and equivalence
-       (equality) and the top level is also shown in .csv format.
-       Optionally all logical entailments and equalities are listed
-       as well. If the data set contains ambiguous rules or more
-       occurrences of the same rule the user is warned.
+                     separated) format that can be generated from
+                     Open Office Calc (spreadsheet), derives all shortest rules
+                     for a selected attribute, and writes them to a .csv file
+                     that can be read by OO Calc. The shortest rules may be
+                     partially ordered by implication (entailment) and equivalence
+                     (equality) and the top level is also shown in .csv format.
+                     Optionally all logical entailments and equalities are listed
+                     as well. If the data set contains ambiguous rules or more
+                     occurrences of the same rule the user is warned.
 category:            Data Mining
 extra-source-files:  README
-      
+
 executable:        emping
 hs-source-dirs:    src
 main-is:           Main.hs
-ghc-options:       -fglasgow-exts -O
+
+ghc-options:       -O2 -Wall -Werror -optl-Wl,-s
 other-modules:     CSVParse
                    Codec
                    Reduce
                    Abduce
                    CSVTable
+extensions:        TypeSynonymInstances
diff --git a/README b/README
--- a/README
+++ b/README
@@ -1,17 +1,18 @@
 The compressed archive contains source files in the functional programming language Haskell.
+
 Emping should run on any platform which has the Glasgow Haskell compiler installed.
 
-The preferred way to install emping is through Cabal, for example:
+The preferred way to install Emping is through Cabal, for example:
 
-$ runhaskell Setup.lhs configure --prefix=$HOME
-$ runhaskell Setup.lhs build
-$ runhaskell Setup.lhs install
+$ runhaskell Setup configure --prefix=$HOME
+$ runhaskell Setup build
+$ runhaskell Setup install
 
 where the commands might need to follow the prefix:
      /usr/bin/env
 depending on your settings.
 
-You might want to look at: http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program 
+You might want to look at: http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program
 
 and/or the cabal documentation at: http://www.haskell.org/ghc/docs/latest/html/Cabal/index.html
 
@@ -19,9 +20,9 @@
 
 -------------------------------------------
 
-Or, put the the source files in a directory of your choice and compile them with:
+Or, put the source files in a directory of your choice and compile them with:
 
-ghc -fglasgow-exts --make -O Main.hs -o emping
+ghc -XTypeSynonymInstances --make -O2 Main.hs -o emping
 
-where ghc is the Haskell compiler and emping is the executable. 
-(-fglasgow-exts is a required option and -O (upper case) optimizes the compilation)
+where 'ghc' is the Haskell compiler and emping is the executable.
+(-XTypeSynonymInstances is a required option and -O2 (upper case Oh) optimizes the compiled executable.)
diff --git a/dist/build/autogen/Paths_Emping.hs b/dist/build/autogen/Paths_Emping.hs
new file mode 100644
--- /dev/null
+++ b/dist/build/autogen/Paths_Emping.hs
@@ -0,0 +1,26 @@
+module Paths_Emping (
+	version,
+	getBinDir, getLibDir, getDataDir, getLibexecDir,
+	getDataFileName
+	) where
+
+import Data.Version
+
+version :: Version
+version = Version {versionBranch = [0,3], versionTags = []}
+
+bindir, libdir, datadir, libexecdir :: FilePath
+
+bindir     = "/home/gwern/bin/bin"
+libdir     = "/home/gwern/bin/lib/Emping-0.3/ghc-6.8.2"
+datadir    = "/home/gwern/bin/share/Emping-0.3"
+libexecdir = "/home/gwern/bin/libexec"
+
+getBinDir, getLibDir, getDataDir, getLibexecDir :: IO FilePath
+getBinDir = return bindir
+getLibDir = return libdir
+getDataDir = return datadir
+getLibexecDir = return libexecdir
+
+getDataFileName :: FilePath -> IO FilePath
+getDataFileName name = return (datadir ++ "/" ++ name)
diff --git a/dist/build/emping/emping b/dist/build/emping/emping
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping differ
diff --git a/dist/build/emping/emping-tmp/Abduce.hi b/dist/build/emping/emping-tmp/Abduce.hi
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Abduce.hi differ
diff --git a/dist/build/emping/emping-tmp/Abduce.o b/dist/build/emping/emping-tmp/Abduce.o
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Abduce.o differ
diff --git a/dist/build/emping/emping-tmp/CSVParse.hi b/dist/build/emping/emping-tmp/CSVParse.hi
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/CSVParse.hi differ
diff --git a/dist/build/emping/emping-tmp/CSVParse.o b/dist/build/emping/emping-tmp/CSVParse.o
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/CSVParse.o differ
diff --git a/dist/build/emping/emping-tmp/CSVTable.hi b/dist/build/emping/emping-tmp/CSVTable.hi
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/CSVTable.hi differ
diff --git a/dist/build/emping/emping-tmp/CSVTable.o b/dist/build/emping/emping-tmp/CSVTable.o
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/CSVTable.o differ
diff --git a/dist/build/emping/emping-tmp/Codec.hi b/dist/build/emping/emping-tmp/Codec.hi
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Codec.hi differ
diff --git a/dist/build/emping/emping-tmp/Codec.o b/dist/build/emping/emping-tmp/Codec.o
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Codec.o differ
diff --git a/dist/build/emping/emping-tmp/Main.hi b/dist/build/emping/emping-tmp/Main.hi
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Main.hi differ
diff --git a/dist/build/emping/emping-tmp/Main.o b/dist/build/emping/emping-tmp/Main.o
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Main.o differ
diff --git a/dist/build/emping/emping-tmp/Reduce.hi b/dist/build/emping/emping-tmp/Reduce.hi
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Reduce.hi differ
diff --git a/dist/build/emping/emping-tmp/Reduce.o b/dist/build/emping/emping-tmp/Reduce.o
new file mode 100644
Binary files /dev/null and b/dist/build/emping/emping-tmp/Reduce.o differ
diff --git a/dist/setup-config b/dist/setup-config
new file mode 100644
--- /dev/null
+++ b/dist/setup-config
@@ -0,0 +1,1 @@
+LocalBuildInfo {installDirTemplates = InstallDirTemplates {prefixDirTemplate = "/home/gwern/bin", binDirTemplate = "$prefix/bin", libDirTemplate = "$prefix/lib", libSubdirTemplate = "$pkgid/$compiler", libexecDirTemplate = "$prefix/libexec", progDirTemplate = "$libdir/hugs/programs", includeDirTemplate = "$libdir/$libsubdir/include", dataDirTemplate = "/home/gwern/bin/share", dataSubdirTemplate = "$pkgid", docDirTemplate = "$datadir/doc/$pkgid", htmlDirTemplate = "$docdir/html", interfaceDirTemplate = "$docdir/html"}, compiler = Compiler {compilerFlavor = GHC, compilerId = PackageIdentifier {pkgName = "ghc", pkgVersion = Version {versionBranch = [6,8,2], versionTags = []}}, compilerExtensions = [(CPP,"-XCPP"),(PatternGuards,"-XPatternGuards"),(UnicodeSyntax,"-XUnicodeSyntax"),(MagicHash,"-XMagicHash"),(PolymorphicComponents,"-XPolymorphicComponents"),(ExistentialQuantification,"-XExistentialQuantification"),(KindSignatures,"-XKindSignatures"),(PatternSignatures,"-XPatternSignatures"),(EmptyDataDecls,"-XEmptyDataDecls"),(ParallelListComp,"-XParallelListComp"),(ForeignFunctionInterface,"-XForeignFunctionInterface"),(UnliftedFFITypes,"-XUnliftedFFITypes"),(LiberalTypeSynonyms,"-XLiberalTypeSynonyms"),(Rank2Types,"-XRank2Types"),(RankNTypes,"-XRankNTypes"),(TypeOperators,"-XTypeOperators"),(RecursiveDo,"-XRecursiveDo"),(Arrows,"-XArrows"),(TemplateHaskell,"-XTemplateHaskell"),(Generics,"-XGenerics"),(NoImplicitPrelude,"-XNoImplicitPrelude"),(RecordWildCards,"-XRecordWildCards"),(RecordPuns,"-XRecordPuns"),(DisambiguateRecordFields,"-XDisambiguateRecordFields"),(OverloadedStrings,"-XOverloadedStrings"),(GADTs,"-XGADTs"),(TypeFamilies,"-XTypeFamilies"),(BangPatterns,"-XBangPatterns"),(NoMonomorphismRestriction,"-XNoMonomorphismRestriction"),(NoMonoPatBinds,"-XNoMonoPatBinds"),(RelaxedPolyRec,"-XRelaxedPolyRec"),(ExtendedDefaultRules,"-XExtendedDefaultRules"),(ImplicitParams,"-XImplicitParams"),(ScopedTypeVariables,"-XScopedTypeVariables"),(UnboxedTuples,"-XUnboxedTuples"),(StandaloneDeriving,"-XStandaloneDeriving"),(DeriveDataTypeable,"-XDeriveDataTypeable"),(TypeSynonymInstances,"-XTypeSynonymInstances"),(FlexibleContexts,"-XFlexibleContexts"),(FlexibleInstances,"-XFlexibleInstances"),(ConstrainedClassMethods,"-XConstrainedClassMethods"),(MultiParamTypeClasses,"-XMultiParamTypeClasses"),(FunctionalDependencies,"-XFunctionalDependencies"),(GeneralizedNewtypeDeriving,"-XGeneralizedNewtypeDeriving"),(OverlappingInstances,"-XOverlappingInstances"),(UndecidableInstances,"-XUndecidableInstances"),(IncoherentInstances,"-XIncoherentInstances")]}, buildDir = "dist/build", scratchDir = "dist/scratch", packageDeps = [PackageIdentifier {pkgName = "base", pkgVersion = Version {versionBranch = [3,0,1,0], versionTags = []}},PackageIdentifier {pkgName = "parsec", pkgVersion = Version {versionBranch = [2,1,0,0], versionTags = []}},PackageIdentifier {pkgName = "containers", pkgVersion = Version {versionBranch = [0,1,0,1], versionTags = []}},PackageIdentifier {pkgName = "array", pkgVersion = Version {versionBranch = [0,1,0,0], versionTags = []}},PackageIdentifier {pkgName = "mtl", pkgVersion = Version {versionBranch = [1,1,0,0], versionTags = []}}], pkgDescrFile = Just "Emping.cabal", localPkgDescr = PackageDescription {package = PackageIdentifier {pkgName = "Emping", pkgVersion = Version {versionBranch = [0,3], versionTags = []}}, license = GPL, licenseFile = "LICENSE", copyright = "Hans van Thiel 2006 - 2007", maintainer = "hthiel.char@zonnet.nl", author = "Hans van Thiel", stability = "experimental", testedWith = [], homepage = "j-van-thiel.speedlinq.nl/", pkgUrl = "", synopsis = "derives heuristic rules from nominal data", description = "utility that reads a table in a csv (comma\nseparated) format that can be generated from\nOpen Office Calc (spreadsheet), derives all shortest rules\nfor a selected attribute, and writes them to a .csv file\nthat can be read by OO Calc. The shortest rules may be\npartially ordered by implication (entailment) and equivalence\n(equality) and the top level is also shown in .csv format.\nOptionally all logical entailments and equalities are listed\nas well. If the data set contains ambiguous rules or more\noccurrences of the same rule the user is warned.", category = "Data Mining", buildDepends = [Dependency "base" AnyVersion,Dependency "parsec" AnyVersion,Dependency "containers" AnyVersion,Dependency "array" AnyVersion,Dependency "mtl" AnyVersion], descCabalVersion = AnyVersion, buildType = Simple, library = Nothing, executables = [Executable {exeName = "emping", modulePath = "Main.hs", buildInfo = BuildInfo {buildable = True, buildTools = [], cppOptions = [], ccOptions = [], ldOptions = [], pkgconfigDepends = [], frameworks = [], cSources = [], hsSourceDirs = ["src"], otherModules = ["CSVParse","Codec","Reduce","Abduce","CSVTable"], extensions = [TypeSynonymInstances], extraLibs = [], extraLibDirs = [], includeDirs = [], includes = [], installIncludes = [], options = [(GHC,["-O2","-Wall","-Werror","-optl-Wl,-s"])], ghcProfOptions = [], ghcSharedOptions = []}}], dataFiles = [], extraSrcFiles = ["README"], extraTmpFiles = []}, withPrograms = [("alex",ConfiguredProgram {programId = "alex", programVersion = Just (Version {versionBranch = [2,2], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/alex"}}),("ar",ConfiguredProgram {programId = "ar", programVersion = Nothing, programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/ar"}}),("c2hs",ConfiguredProgram {programId = "c2hs", programVersion = Just (Version {versionBranch = [0,15,1], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/c2hs"}}),("cpphs",ConfiguredProgram {programId = "cpphs", programVersion = Just (Version {versionBranch = [1,5], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/cpphs"}}),("ghc",ConfiguredProgram {programId = "ghc", programVersion = Just (Version {versionBranch = [6,8,2], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/ghc"}}),("ghc-pkg",ConfiguredProgram {programId = "ghc-pkg", programVersion = Just (Version {versionBranch = [6,8,2], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/ghc-pkg"}}),("haddock",ConfiguredProgram {programId = "haddock", programVersion = Just (Version {versionBranch = [0,9], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/haddock"}}),("happy",ConfiguredProgram {programId = "happy", programVersion = Just (Version {versionBranch = [1,17], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/happy"}}),("hsc2hs",ConfiguredProgram {programId = "hsc2hs", programVersion = Just (Version {versionBranch = [0,66], versionTags = ["ghc"]}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/hsc2hs"}}),("hscolour",ConfiguredProgram {programId = "hscolour", programVersion = Just (Version {versionBranch = [1,8], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/HsColour"}}),("ld",ConfiguredProgram {programId = "ld", programVersion = Nothing, programArgs = ["-x"], programLocation = FoundOnSystem {locationPath = "/usr/bin/ld"}}),("pkg-config",ConfiguredProgram {programId = "pkg-config", programVersion = Just (Version {versionBranch = [0,22], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/pkg-config"}}),("ranlib",ConfiguredProgram {programId = "ranlib", programVersion = Nothing, programArgs = [], programLocation = FoundOnSystem {locationPath = "/usr/bin/ranlib"}}),("tar",ConfiguredProgram {programId = "tar", programVersion = Nothing, programArgs = [], programLocation = FoundOnSystem {locationPath = "/bin/tar"}})], withPackageDB = UserPackageDB, withVanillaLib = True, withProfLib = False, withSharedLib = False, withProfExe = False, withOptimization = True, withGHCiLib = True, splitObjs = False}
diff --git a/src/Abduce.hs b/src/Abduce.hs
--- a/src/Abduce.hs
+++ b/src/Abduce.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE TypeSynonymInstances #-}
 module Abduce ( abdAll, treehasED, cntEDAtt ) where
 
 -- module: get partial order, if any, of RNF rules
@@ -27,7 +28,7 @@
 -- unordered elements are in the same subforest
 
 ins2Tree :: Poset a => a -> Tree a -> Tree a
-ins2Tree x t = 
+ins2Tree x t =
  case pcompare x (rootLabel t) of
     LW -> Node (rootLabel t) (ins2Forest x (subForest t))
     HI -> Node x (t:[])
@@ -35,15 +36,15 @@
 
 ins2Forest :: Poset a => a -> Forest a -> Forest a
 ins2Forest x [] = (Node x []):[]
-ins2Forest x for 
+ins2Forest x for
   | new == for = (Node x []):for
   | otherwise = new
-    where new = map (ins2Tree x) for   
+    where new = map (ins2Tree x) for
 
 -- put a list of partially ordered elements in forest
 
 isRoot :: Poset a => [a] -> a -> Bool
-isRoot ls x = and $ map ((LW /=) . (x `pcompare`)) ls 
+isRoot ls x = and $ map ((LW /=) . (x `pcompare`)) ls
 
 initRoots :: Poset a => [a] -> Forest a
 initRoots ls = map mkLeaf ls where
@@ -55,12 +56,12 @@
 
 list2Forest :: Poset a => [a] -> Forest a
 list2Forest ls = lsinFor res for where
-                     (x,res) = partition (isRoot ls) ls 
-                     for = initRoots x  
+                     (x,res) = partition (isRoot ls) ls
+                     for = initRoots x
 -----------------------------------------------------
 -----------------------------------------------------
 
--- A: match indices of reduced rules with indices of 
+-- A: match indices of reduced rules with indices of
 -- the original(s) denoted by a reduced rule
 
 -- indices of original rule(s) denoted by reduced
@@ -120,7 +121,7 @@
 -- a poset forest
 
 redOrgs2Forest :: (Eq a, Eq b) => [[(a,b)]] -> [[(a,b)]] -> Forest RuRe
-redOrgs2Forest rules reds = 
+redOrgs2Forest rules reds =
           list2Forest (redOrgs2Eqs rules reds)
 
 -- order is determined, original indices no longer needed
@@ -132,7 +133,7 @@
 -- indices of equals in one list (rules WITH cons)
 
 reds2EqsFor :: (Eq a, Eq b)=> [[(a,b)]] -> [[(a,b)]] -> Forest [Int]
-reds2EqsFor rules reds = 
+reds2EqsFor rules reds =
               remOrgs (redOrgs2Forest rules reds)
 
 -- replace indices list with rule list (of equals)
@@ -159,20 +160,20 @@
 -- check if a tree contains a branch and/or equals
 
 treehasED :: (Eq a, Eq b) => Tree [[(a,b)]] -> Bool
-treehasED t | length (rootLabel t) == 1 
+treehasED t | length (rootLabel t) == 1
               && subForest t == [] = False
             | otherwise = True
 
--- count branches and/or equals in forest, 
+-- count branches and/or equals in forest,
 -- fst is number of chains, snd number of singles
 
 cntEDVal :: (Eq a, Eq b) => Forest [[(a,b)]] -> (Int,Int)
-cntEDVal for = (dep, single) where 
-       dep = sum $ fst (unzip temp) 
-       single = sum $ snd (unzip temp) 
-       temp = map (mark . treehasED) for  
+cntEDVal for = (dep, single) where
+       dep = sum $ fst (unzip temp)
+       single = sum $ snd (unzip temp)
+       temp = map (mark . treehasED) for
        mark x | x == True = (1,0)
-              | otherwise = (0,1) 
+              | otherwise = (0,1)
 
 -- count branches and/or equals in attribute abduction
 -- fst is chain count, snd is number of unconnected rules
@@ -180,5 +181,5 @@
 cntEDAtt :: (Eq a, Eq b) => [Forest [[(a,b)]] ] -> (Int,Int)
 cntEDAtt forls = (dep, uncon) where
              dep = sum $ fst (unzip temp)
-             uncon = sum $ snd (unzip temp) 
+             uncon = sum $ snd (unzip temp)
              temp = map cntEDVal forls
