diff --git a/README-1ST.txt b/README-1ST.txt
deleted file mode 100644
--- a/README-1ST.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-This is an "inofficial release" of the version of Yampa that uses GADT-enabled
-dynamic optimization as described in the ICFP'05 paper "Dynamic Optimization
-for Functional Reactive Programming using Generalized Algebraic Data Types".
-
-The code is being made available only because a number of people have asked
-for it. It is not supposed to be useful in any way as it stands. If it happens
-to be useful to you, great, it's your lucky day!
-
-The code is very messy at least at two levels:
-
-  * Work in progress: lots of code fragments from trying out various
-    approaches around; the code for the most successful approaches never got
-    tidied up; the GADT optimizations have not been implemented throughout;
-    lots of notes and comments around, some of which may still be relevant,
-    others which are not, and others which only ever were of interest to me;
-    etc.
-
-  * The fundamental approach taken does not really scale that well
-    as one gets a (small) combinatorial explosion of cases to
-    consider for optimization. Thus there is way more code here than
-    one would hope, some of it quite repetitive.
-
-Use at your own risk! ;-)
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/Setup.lhs b/Setup.lhs
deleted file mode 100644
--- a/Setup.lhs
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env runhaskell
-> import Distribution.Simple
-> main = defaultMain
diff --git a/Yampa.cabal b/Yampa.cabal
--- a/Yampa.cabal
+++ b/Yampa.cabal
@@ -1,20 +1,21 @@
 name: Yampa
-version: 0.9.2.3
-cabal-Version: >= 1.2
+version: 0.9.3
+cabal-version: >= 1.6
 license: BSD3
 license-file: LICENSE
 author: Henrik Nilsson, Antony Courtney
-maintainer: George Giorgidze (GGG at CS dot NOTT dot AC dot UK)
-homepage: http://www.haskell.org/yampa/
+maintainer: George Giorgidze (giorgidze@gmail.com)
+homepage: http://www.haskell.org/haskellwiki/Yampa
 category: Reactivity, FRP
 synopsis: Library for programming hybrid systems.
-description: Domain-specific language embedded in Haskell for programming hybrid (mixed discrete-time and continuous-time) systems.
-             Yampa is based on the concepts of Functional Reactive Programming (FRP) and is structured using arrow combinators.
-build-type: Simple
-Tested-With:        GHC
-Extra-Source-Files:
-  README-1ST.txt
 
+description:  Domain-specific language embedded in Haskell for programming
+              hybrid (mixed discrete-time and continuous-time) systems. Yampa is based on
+              the concepts of Functional Reactive Programming (FRP) and is structured using
+              arrow combinators.
+
+build-type: Simple
+extra-source-files:
   tests/AFRPTests.hs,         tests/AFRPTestsCommon.hs,        tests/AFRPTestsArr.hs,
   tests/AFRPTestsComp.hs,     tests/AFRPTestsFirstSecond.hs,   tests/AFRPTestsLaws.hs,
   tests/AFRPTestsLoop.hs,     tests/AFRPTestsLoopLaws.hs,      tests/AFRPTestsBasicSF.hs,
@@ -25,9 +26,7 @@
   tests/AFRPTestsDer.hs,      tests/AFRPTestsLoopPre.hs,       tests/AFRPTestsLoopIntegral.hs,
   tests/AFRPTestsReact.hs,    tests/AFRPTestsEmbed.hs,         tests/AFRPTestsUtils.hs,
   tests/AFRPTestsTask.hs,     tests/testAFRPMain.hs,
-  tests/Setup.lhs,            tests/testAFRP.cabal,
 
-  examples/Setup.lhs,         examples/examples.cabal,
   examples/Elevator/Elevator.hs,
   examples/Elevator/TestElevatorMain.hs,
   examples/TailgatingDetector/TailgatingDetector.hs,
@@ -35,8 +34,8 @@
 
 library
   hs-source-dirs:  src
-  ghc-options : -O2 -Wall -fno-warn-name-shadowing
-  build-Depends: base, random
+  ghc-options : -O3 -Wall -fno-warn-name-shadowing
+  build-Depends: base < 5, random
   exposed-modules:
     FRP.Yampa
     FRP.Yampa.AffineSpace
@@ -55,3 +54,7 @@
     FRP.Yampa.Internals
   other-modules:
     FRP.Yampa.Diagnostics
+
+source-repository head
+  type:     git
+  location: git://github.com/giorgidze/Yampa.git
diff --git a/examples/Elevator/Elevator.hs b/examples/Elevator/Elevator.hs
--- a/examples/Elevator/Elevator.hs
+++ b/examples/Elevator/Elevator.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE Arrows #-}
+
 {-
 ******************************************************************************
 *                                  A F R P                                   *
diff --git a/examples/Setup.lhs b/examples/Setup.lhs
deleted file mode 100644
--- a/examples/Setup.lhs
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env runhaskell
-> import Distribution.Simple
-> main = defaultMain
diff --git a/examples/TailgatingDetector/TailgatingDetector.hs b/examples/TailgatingDetector/TailgatingDetector.hs
--- a/examples/TailgatingDetector/TailgatingDetector.hs
+++ b/examples/TailgatingDetector/TailgatingDetector.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE Arrows #-}
+
 {-
 ******************************************************************************
 *                                  A F R P                                   *
diff --git a/examples/TailgatingDetector/TestTGMain.hs b/examples/TailgatingDetector/TestTGMain.hs
--- a/examples/TailgatingDetector/TestTGMain.hs
+++ b/examples/TailgatingDetector/TestTGMain.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE Arrows #-}
+
 {-
 ******************************************************************************
 *                                  A F R P                                   *
@@ -86,14 +88,13 @@
 testMTGD t_max = filter (isEvent . fst . snd) $
                  takeWhile (\(t, _) -> t <= t_max) $
                  embed (localTime
-                        &&& (proc _ -> do
-			         s           <- uavStatus      -< ()
-                                 h           <- highway        -< ()
-                                 (v, ect)    <- mkVideoAndTrackers -< (h, s)
-                                 (ics, etgs) <- findTailgaters -< (v,s,ect) 
-				 etgs        <- mtgd           -< ics
-			         returnA -< (etgs, ics)))
-	        (deltaEncode smplPer (repeat ()))
+                        &&& (proc _ -> do s           <- uavStatus          -< ()
+                                          h           <- highway            -< ()
+                                          (v, ect)    <- mkVideoAndTrackers -< (h, s)
+                                          (ics, etgs) <- findTailgaters     -< (v,s,ect) 
+                                          etgs        <- mtgd               -< ics
+                                          returnA     -< (etgs, ics)))
+                       (deltaEncode smplPer (repeat ()))
 
 ppTestMTGD t = mapM_ (putStrLn . show) (testMTGD t)
 
diff --git a/examples/examples.cabal b/examples/examples.cabal
deleted file mode 100644
--- a/examples/examples.cabal
+++ /dev/null
@@ -1,26 +0,0 @@
-Name:               examples
-Version:            0.0
-Description:        Yampa examples
-License:            BSD3
-License-File:       ../LICENSE.txt
-Copyright:          Henrik Nilsson, Antony Courtney and Yale University, (c) 2003
-Author:             Antony Courtney, Paul Hudak, Henrik Nilsson, John Peterson
-Maintainer:         George Giorgidze (GGG at CS dot NOTT dot AC dot UK)
-Stability:          provisional
-Homepage:           http://www.haskell.org/yampa/
-Category:           Reactivity, FRP
-Synopsis:           Yampa examples
-Build-Depends:      base, haskell98, Yampa >= 0.9.2
-
-Executable:         Elevator
-Main-is:            testElevatorMain.hs
-ghc-options:        -O -fglasgow-exts -farrows
-Hs-Source-Dirs:     Elevator
-Other-modules:      Elevator
-
-Executable:         TailgatingDetector
-Main-is:            TestTGMain.hs
-ghc-options:        -O -fglasgow-exts -farrows
-Hs-Source-Dirs:     TailgatingDetector
-Other-modules:      TailgatingDetector
-
diff --git a/src/FRP/Yampa.hs b/src/FRP/Yampa.hs
--- a/src/FRP/Yampa.hs
+++ b/src/FRP/Yampa.hs
@@ -3169,9 +3169,8 @@
      let (sf,b0) = tf0 a0
      -- TODO: really need to fix this interface, since right now we
      -- just ignore termination at time 0:
-     r <- newIORef (ReactState {rsActuate = actuate, rsSF = sf,
-				rsA = a0, rsB = b0 })
-     done <- actuate r True b0
+     r <- newIORef (ReactState {rsActuate = actuate, rsSF = sf, rsA = a0, rsB = b0 })
+     _ <- actuate r True b0
      return r
 
 -- process a single input sample:
@@ -3179,10 +3178,7 @@
       -> (DTime,Maybe a)
       -> IO Bool
 react rh (dt,ma') = 
-  do rs@(ReactState {rsActuate = actuate,
-	             rsSF = sf,
-		     rsA = a,
-		     rsB = b }) <- readIORef rh
+  do rs@(ReactState {rsActuate = actuate, rsSF = sf, rsA = a, rsB = _b }) <- readIORef rh
      let a' = maybe a id ma'
          (sf',b') = (sfTF' sf) dt a'
      writeIORef rh (rs {rsSF = sf',rsA = a',rsB = b'})
diff --git a/src/FRP/Yampa/Event.hs b/src/FRP/Yampa/Event.hs
--- a/src/FRP/Yampa/Event.hs
+++ b/src/FRP/Yampa/Event.hs
@@ -94,10 +94,7 @@
 -- Also note that it unfortunately is possible to partially break the
 -- abstractions through judicious use of e.g. snap and switching.
 
-data Event a = NoEvent
-	     | Event a
---             deriving Show
-
+data Event a = NoEvent | Event a deriving (Show)
 
 -- Make the NoEvent constructor available. Useful e.g. for initialization,
 -- ((-->) & friends), and it's easily available anyway (e.g. mergeEvents []).
diff --git a/src/FRP/Yampa/Internals.hs b/src/FRP/Yampa/Internals.hs
--- a/src/FRP/Yampa/Internals.hs
+++ b/src/FRP/Yampa/Internals.hs
@@ -19,19 +19,7 @@
 -----------------------------------------------------------------------------------------
 
 module FRP.Yampa.Internals (
-    Event(..)		-- The event type, its constructors, and instances.
+    Event(..)
 ) where
 
 import FRP.Yampa.Event
-
-
-------------------------------------------------------------------------------
--- Extra Event instances
-------------------------------------------------------------------------------
-
-instance Show a => Show (Event a) where
-    showsPrec d NoEvent   = showString "NoEvent"
-    showsPrec d (Event a) = showParen (d >= 10)
-				      (showString "Event " . showsPrec 10 a)
-
-
diff --git a/src/FRP/Yampa/VectorSpace.hs b/src/FRP/Yampa/VectorSpace.hs
--- a/src/FRP/Yampa/VectorSpace.hs
+++ b/src/FRP/Yampa/VectorSpace.hs
@@ -29,7 +29,7 @@
 -- be Fractional (roughly a Field) rather than Floating.
 
 -- Minimal instance: zeroVector, (*^), (^+^), dot
-class Floating a => VectorSpace v a | v -> a where
+class (Eq a, Floating a) => VectorSpace v a | v -> a where
     zeroVector   :: v
     (*^)         :: a -> v -> v
     (^/)         :: v -> a -> v
@@ -92,7 +92,7 @@
 -- Vector space instances for small tuples of Floating
 ------------------------------------------------------------------------------
 
-instance Floating a => VectorSpace (a,a) a where
+instance (Eq a, Floating a) => VectorSpace (a,a) a where
     zeroVector = (0,0)
 
     a *^ (x,y) = (a * x, a * y)
@@ -108,7 +108,7 @@
     (x1,y1) `dot` (x2,y2) = x1 * x2 + y1 * y2
 
 
-instance Floating a => VectorSpace (a,a,a) a where
+instance (Eq a, Floating a) => VectorSpace (a,a,a) a where
     zeroVector = (0,0,0)
 
     a *^ (x,y,z) = (a * x, a * y, a * z)
@@ -124,7 +124,7 @@
     (x1,y1,z1) `dot` (x2,y2,z2) = x1 * x2 + y1 * y2 + z1 * z2
 
 
-instance Floating a => VectorSpace (a,a,a,a) a where
+instance (Eq a, Floating a) => VectorSpace (a,a,a,a) a where
     zeroVector = (0,0,0,0)
 
     a *^ (x,y,z,u) = (a * x, a * y, a * z, a * u)
@@ -140,7 +140,7 @@
     (x1,y1,z1,u1) `dot` (x2,y2,z2,u2) = x1 * x2 + y1 * y2 + z1 * z2 + u1 * u2
 
 
-instance Floating a => VectorSpace (a,a,a,a,a) a where
+instance (Eq a, Floating a) => VectorSpace (a,a,a,a,a) a where
     zeroVector = (0,0,0,0,0)
 
     a *^ (x,y,z,u,v) = (a * x, a * y, a * z, a * u, a * v)
@@ -155,6 +155,3 @@
 
     (x1,y1,z1,u1,v1) `dot` (x2,y2,z2,u2,v2) =
         x1 * x2 + y1 * y2 + z1 * z2 + u1 * u2 + v1 * v2
-
-
-
diff --git a/tests/Setup.lhs b/tests/Setup.lhs
deleted file mode 100644
--- a/tests/Setup.lhs
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env runhaskell
-> import Distribution.Simple
-> main = defaultMain
diff --git a/tests/testAFRP.cabal b/tests/testAFRP.cabal
deleted file mode 100644
--- a/tests/testAFRP.cabal
+++ /dev/null
@@ -1,45 +0,0 @@
-Name:               testAFRP
-Version:            0.0
-Description:        Tests for Yampa functions.
-License:            BSD3
-License-File:       ../LICENSE
-Copyright:          Henrik Nilsson, Antony Courtney and Yale University, (c) 2003
-Author:             Antony Courtney, Paul Hudak, Henrik Nilsson, John Peterson
-Maintainer:         Antony Courtney	<antony@apocalypse.org>, Paul Hudak	<paul.hudak@yale.edu>, Henrik Nilsson	<nilsson@cs.yale.edu>, John Peterson	<peterson-john@cs.yale.edu>
-Stability:          provisional
-Homepage:           http://www.haskell.org/yampa/
-Category:           Reactivity, FRP
-Synopsis:           Tests for Yampa functions.
-Build-Depends:       base, Yampa >= 0.9.2
-
-Executable:          testAFRP
-Main-is:             testAFRPMain.hs
-ghc-options:         -O2 -fglasgow-exts 
-Other-modules:      AFRPTests,
-                    AFRPTestsCommon,
-                    AFRPTestsArr,
-                    AFRPTestsComp,
-                    AFRPTestsFirstSecond,
-                    AFRPTestsLaws,
-                    AFRPTestsLoop,
-                    AFRPTestsLoopLaws,
-                    AFRPTestsBasicSF,
-                    AFRPTestsSscan,
-                    AFRPTestsEvSrc,
-                    AFRPTestsCOC,
-                    AFRPTestsSwitch,
-                    AFRPTestsKSwitch,
-                    AFRPTestsRSwitch,
-                    AFRPTestsPSwitch,
-                    AFRPTestsRPSwitch,
-                    AFRPTestsWFG,
-                    AFRPTestsAccum,
-                    AFRPTestsPre,
-                    AFRPTestsDelay,
-                    AFRPTestsDer,
-                    AFRPTestsLoopPre,
-                    AFRPTestsLoopIntegral,
-                    AFRPTestsReact,
-                    AFRPTestsEmbed,
-                    AFRPTestsUtils,
-                    AFRPTestsTask
