diff --git a/.DS_Store b/.DS_Store
new file mode 100644
Binary files /dev/null and b/.DS_Store differ
diff --git a/._.DS_Store b/._.DS_Store
new file mode 100644
Binary files /dev/null and b/._.DS_Store differ
diff --git a/._LICENSE b/._LICENSE
new file mode 100644
Binary files /dev/null and b/._LICENSE differ
diff --git a/._ParserFunction.cabal b/._ParserFunction.cabal
new file mode 100644
Binary files /dev/null and b/._ParserFunction.cabal differ
diff --git a/._Setup.hs b/._Setup.hs
new file mode 100644
Binary files /dev/null and b/._Setup.hs differ
diff --git a/._Text b/._Text
new file mode 100644
Binary files /dev/null and b/._Text differ
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2008 Enzo Haussecker
+Copyright (c) 2011 Enzo Haussecker
 
 Permission is hereby granted, free of charge, to any person obtaining this work and associated documentation files (the "Work"), to deal in the Work without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Work, and to permit persons to whom the Work is furnished to do so, subject to the following conditions:
 
diff --git a/ParserFunction.cabal b/ParserFunction.cabal
--- a/ParserFunction.cabal
+++ b/ParserFunction.cabal
@@ -1,18 +1,23 @@
-Name:            ParserFunction
-Version:         0.0.3
-License:         BSD3
-License-file:    LICENSE
-Author:          Enzo Haussecker
-Synopsis:        An algorithm for parsing Expressions.
-Description:     The centerpiece of this package is a function called "expressionToDouble", which parses an expression (in the form of a string) and returns a Double. Examples of this function can be found by viewing the source code for this module.
-Build-Depends:   base, parsec, containers
-stability:       Stable
-Category:        Parsing
-build-type:      Simple
-cabal-version:   >= 1.2
-tested-with:     GHC ==6.8.2
-
-Exposed-modules: 
-	Text.ParserCombinators.Parsec.ParserFunction
+name:          ParserFunction
+version:       0.0.4
+cabal-version: >= 1.6
+license:       BSD3
+license-file:  LICENSE
+author:        Enzo Haussecker
+maintainer:    ehaussecker@gmail.com
+category:      Parsing
+synopsis:      Utilities for parsing and evaluating string-expressions.
+description:
+    ParserFunction provides utilities for parsing and evaluating string-expressions.
+    The centerpiece of this module is a function called @evalStrExpr@,
+    which evaluates a string-expression using a variable lookup map.
+    Example: @evalStrExpr@ \"exp(x)\" [(\'x\',1)] gives 2.718281828459045.
+    More examples can be found by viewing the source code for this module.
+    This module also exports all supporting functionality.
 
+build-type: Simple
 
+Library
+  exposed-modules:
+    Text.ParserCombinators.Parsec.ParserFunction
+  build-depends: base < 6, parsec, containers
diff --git a/Text/.DS_Store b/Text/.DS_Store
new file mode 100644
Binary files /dev/null and b/Text/.DS_Store differ
diff --git a/Text/._.DS_Store b/Text/._.DS_Store
new file mode 100644
Binary files /dev/null and b/Text/._.DS_Store differ
diff --git a/Text/._ParserCombinators b/Text/._ParserCombinators
new file mode 100644
Binary files /dev/null and b/Text/._ParserCombinators differ
diff --git a/Text/ParserCombinators/.DS_Store b/Text/ParserCombinators/.DS_Store
new file mode 100644
Binary files /dev/null and b/Text/ParserCombinators/.DS_Store differ
diff --git a/Text/ParserCombinators/._.DS_Store b/Text/ParserCombinators/._.DS_Store
new file mode 100644
Binary files /dev/null and b/Text/ParserCombinators/._.DS_Store differ
diff --git a/Text/ParserCombinators/._Parsec b/Text/ParserCombinators/._Parsec
new file mode 100644
Binary files /dev/null and b/Text/ParserCombinators/._Parsec differ
diff --git a/Text/ParserCombinators/Parsec/.DS_Store b/Text/ParserCombinators/Parsec/.DS_Store
new file mode 100644
Binary files /dev/null and b/Text/ParserCombinators/Parsec/.DS_Store differ
diff --git a/Text/ParserCombinators/Parsec/._.DS_Store b/Text/ParserCombinators/Parsec/._.DS_Store
new file mode 100644
Binary files /dev/null and b/Text/ParserCombinators/Parsec/._.DS_Store differ
diff --git a/Text/ParserCombinators/Parsec/._ParserFunction.hs b/Text/ParserCombinators/Parsec/._ParserFunction.hs
new file mode 100644
Binary files /dev/null and b/Text/ParserCombinators/Parsec/._ParserFunction.hs differ
diff --git a/Text/ParserCombinators/Parsec/ParserFunction.hs b/Text/ParserCombinators/Parsec/ParserFunction.hs
--- a/Text/ParserCombinators/Parsec/ParserFunction.hs
+++ b/Text/ParserCombinators/Parsec/ParserFunction.hs
@@ -1,25 +1,20 @@
 ---   ParserFunction
 ---   by Enzo Haussecker
 
----   The centerpiece of this module is a function called: expressionToDouble, 
----   which parses an expression (in the form of a string) and returns a Double.
-
----   You must declare all variables in the expression! 
+---   The centerpiece of this module is a function called: evalStrExpr, 
+---   which evaluates a string-expression using a variable lookup map.
 
----   Examples are as fallows.
+---   Examples of evalStrExpr are as fallows.
 
----   > expressionToDouble "5 - 2" []
+---   > evalStrExpr "5 - 2" []
 ---   3.0
-
-
----   > expressionToDouble "x^2 + y" [('x',2),('y',3)]
+---   > evalStrExpr "x^2 + y" [('x',2),('y',3)]
 ---   7.0
-
----   > expressionToDouble "cos(x)" [('x',pi)]
+---   > evalStrExpr "cos(x)" [('x',pi)]
 ---   -1.0
 
 module Text.ParserCombinators.Parsec.ParserFunction
-    (expressionToDouble) where
+    (Expr,evalStrExpr,strToExpr,buildExpr,expressionTable,factor,variables,number,evaluate) where
 
 import Text.ParserCombinators.Parsec.Expr 
 import Text.ParserCombinators.Parsec
@@ -28,6 +23,7 @@
 import Data.List (isInfixOf)
 import Data.Char (toLower)
 
+-- The Expr data type provides a basis for ordering mathematical operations.
 data Expr = Num Double    | Var Char      | Sub Expr Expr
           | Div Expr Expr | Pow Expr Expr | Log Expr
           | Abs Expr      | Sqrt Expr     | Cbrt Expr
@@ -41,14 +37,18 @@
           | Sec Expr      | Csc Expr      | Cot Expr
           | Mul Expr Expr | Add Expr Expr | Exp Expr deriving (Show, Eq, Ord)
 
-expressionToDouble :: String -> [(Char,Double)] -> Double
-expressionToDouble s m = eval (M.fromAscList $ caseMap m) (fromMaybe failing $ stringToExpr s)
+--- evalStrExpr evaluates a string-expression s using the variable lookup map m. 
+evalStrExpr :: String -> [(Char,Double)] -> Double
+evalStrExpr s m = evaluate (M.fromAscList $ caseMap m) (fromMaybe failing $ strToExpr s)
     where 
         caseMap x = fmap (\ (a, b) -> ([toLower a], b)) x
         failing   = error "Parser error in expression"
 
-stringToExpr :: String -> Maybe Expr
-stringToExpr xs = if any (==True) (symbols failingSymbols xs)
+--- strToExpr parses a string-expression and returns an Expr expression, 
+--- or nothing if the string is malformed. A failing example is "2+-2". 
+--- The correct format should be "2+(-2)".
+strToExpr :: String -> Maybe Expr
+strToExpr xs = if any (==True) (symbols failingSymbols xs)
                   then Nothing
                   else either (const Nothing) (Just) (parse buildExpr "" handleString)
     where
@@ -59,6 +59,7 @@
                           "/^","/*","//","/+","/-","+^","+*","+/","++","+-",
                           "-^","-*","-/","-+","--"]
 
+--- buildExpr is the fundamental parsing function.
 buildExpr :: Parser Expr
 buildExpr = buildExpressionParser expressionTable factor
 
@@ -106,44 +107,45 @@
             fe = toInteger . fromEnum
             ch2num = (subtract $ fe '0') . fe
 
-eval :: M.Map String Double -> Expr -> Double
-eval m expr =
+--- evaluate takes a map and expression to produce a numerical value.
+evaluate :: M.Map String Double -> Expr -> Double
+evaluate m expr =
     case expr of 
         (Num d)           -> d
         (Var c)         -> fromMaybe (failing c) (M.lookup [c] m)
-        (Add expr1 expr2) -> (eval m expr1) +  (eval m expr2)
-        (Sub expr1 expr2) -> (eval m expr1) -  (eval m expr2)
-        (Mul expr1 expr2) -> (eval m expr1) *  (eval m expr2)
-        (Div expr1 expr2) -> (eval m expr1) /  (eval m expr2)
-        (Pow expr1 expr2) -> (eval m expr1) ** (eval m expr2)
-        (Exp expr1)       -> exp (eval m expr1)
-        (Sqrt expr1)      -> (eval m expr1) ** (0.5)
-        (Cbrt expr1)      -> (eval m expr1) ** (1/3)
-        (Log expr1)       -> log (eval m expr1)
-        (Abs expr1)       -> abs (eval m expr1)
-        (Sin expr1)       -> sin (eval m expr1) 
-        (Cos expr1)       -> cos (eval m expr1)
-        (Tan expr1)       -> tan (eval m expr1)
-        (Sec expr1)       -> 1/sin (eval m expr1) 
-        (Csc expr1)       -> 1/cos (eval m expr1)
-        (Cot expr1)       -> 1/tan (eval m expr1)
-        (Sinh expr1)      -> sinh (eval m expr1) 
-        (Cosh expr1)      -> cosh (eval m expr1)
-        (Tanh expr1)      -> tanh (eval m expr1)
-        (Sech expr1)      -> 1/sinh (eval m expr1) 
-        (Csch expr1)      -> 1/cosh (eval m expr1)
-        (Coth expr1)      -> 1/tanh (eval m expr1)
-        (ArcSin expr1)    -> asin (eval m expr1) 
-        (ArcCos expr1)    -> acos (eval m expr1)
-        (ArcTan expr1)    -> atan (eval m expr1)
-        (ArcSec expr1)    -> 1/asin (eval m expr1) 
-        (ArcCsc expr1)    -> 1/acos (eval m expr1)
-        (ArcCot expr1)    -> 1/atan (eval m expr1)
-        (ArcSinh expr1)   -> asinh (eval m expr1) 
-        (ArcCosh expr1)   -> acosh (eval m expr1)
-        (ArcTanh expr1)   -> atanh (eval m expr1)
-        (ArcSech expr1)   -> 1/asinh (eval m expr1) 
-        (ArcCsch expr1)   -> 1/acosh (eval m expr1)
-        (ArcCoth expr1)   -> 1/atanh (eval m expr1)
+        (Add expr1 expr2) -> (evaluate m expr1) +  (evaluate m expr2)
+        (Sub expr1 expr2) -> (evaluate m expr1) -  (evaluate m expr2)
+        (Mul expr1 expr2) -> (evaluate m expr1) *  (evaluate m expr2)
+        (Div expr1 expr2) -> (evaluate m expr1) /  (evaluate m expr2)
+        (Pow expr1 expr2) -> (evaluate m expr1) ** (evaluate m expr2)
+        (Exp expr1)       -> exp (evaluate m expr1)
+        (Sqrt expr1)      -> (evaluate m expr1) ** (0.5)
+        (Cbrt expr1)      -> (evaluate m expr1) ** (1/3)
+        (Log expr1)       -> log (evaluate m expr1)
+        (Abs expr1)       -> abs (evaluate m expr1)
+        (Sin expr1)       -> sin (evaluate m expr1) 
+        (Cos expr1)       -> cos (evaluate m expr1)
+        (Tan expr1)       -> tan (evaluate m expr1)
+        (Sec expr1)       -> 1/sin (evaluate m expr1) 
+        (Csc expr1)       -> 1/cos (evaluate m expr1)
+        (Cot expr1)       -> 1/tan (evaluate m expr1)
+        (Sinh expr1)      -> sinh (evaluate m expr1) 
+        (Cosh expr1)      -> cosh (evaluate m expr1)
+        (Tanh expr1)      -> tanh (evaluate m expr1)
+        (Sech expr1)      -> 1/sinh (evaluate m expr1) 
+        (Csch expr1)      -> 1/cosh (evaluate m expr1)
+        (Coth expr1)      -> 1/tanh (evaluate m expr1)
+        (ArcSin expr1)    -> asin (evaluate m expr1) 
+        (ArcCos expr1)    -> acos (evaluate m expr1)
+        (ArcTan expr1)    -> atan (evaluate m expr1)
+        (ArcSec expr1)    -> 1/asin (evaluate m expr1) 
+        (ArcCsc expr1)    -> 1/acos (evaluate m expr1)
+        (ArcCot expr1)    -> 1/atan (evaluate m expr1)
+        (ArcSinh expr1)   -> asinh (evaluate m expr1) 
+        (ArcCosh expr1)   -> acosh (evaluate m expr1)
+        (ArcTanh expr1)   -> atanh (evaluate m expr1)
+        (ArcSech expr1)   -> 1/asinh (evaluate m expr1) 
+        (ArcCsch expr1)   -> 1/acosh (evaluate m expr1)
+        (ArcCoth expr1)   -> 1/atanh (evaluate m expr1)
     where
         failing x = error $ "M.lookup error in value for variable `" ++ [x] ++ "'"
