diff --git a/hTensor.cabal b/hTensor.cabal
--- a/hTensor.cabal
+++ b/hTensor.cabal
@@ -1,5 +1,5 @@
 Name:               hTensor
-Version:            0.6.0
+Version:            0.7.0
 License:            GPL
 License-file:       LICENSE
 Author:             Alberto Ruiz
@@ -28,7 +28,7 @@
 Category:           Math
 tested-with:        GHC ==6.12.1
 
-cabal-version:      >=1.2
+cabal-version:      >=1.6
 build-type:         Simple
 
 extra-source-files:
@@ -42,7 +42,7 @@
     else
       build-depends:    base < 3
 
-    Build-Depends:      hmatrix >= 0.9.3, containers, random
+    Build-Depends:      hmatrix == 0.10.*, containers, random
 
     hs-source-dirs:     lib
     Exposed-modules:    Numeric.LinearAlgebra.Array.Util
diff --git a/lib/Numeric/LinearAlgebra/Array.hs b/lib/Numeric/LinearAlgebra/Array.hs
--- a/lib/Numeric/LinearAlgebra/Array.hs
+++ b/lib/Numeric/LinearAlgebra/Array.hs
@@ -58,7 +58,7 @@
     (/) = zipArray (/)
     recip = mapArray recip
 
-instance (Coord t, Compat i, Fractional (NArray i t), Floating (Vector t)) => Floating (NArray i t) where
+instance (Coord t, Compat i, Fractional (NArray i t), Floating t, Floating (Vector t)) => Floating (NArray i t) where
     sin   = mapArray sin
     cos   = mapArray cos
     tan   = mapArray tan
diff --git a/lib/Numeric/LinearAlgebra/Array/Display.hs b/lib/Numeric/LinearAlgebra/Array/Display.hs
--- a/lib/Numeric/LinearAlgebra/Array/Display.hs
+++ b/lib/Numeric/LinearAlgebra/Array/Display.hs
@@ -18,6 +18,7 @@
 
 import Numeric.LinearAlgebra.Array.Internal
 import Data.Packed
+import Numeric.Container(format)
 import Data.List
 import Text.Printf
 
diff --git a/lib/Numeric/LinearAlgebra/Array/Internal.hs b/lib/Numeric/LinearAlgebra/Array/Internal.hs
--- a/lib/Numeric/LinearAlgebra/Array/Internal.hs
+++ b/lib/Numeric/LinearAlgebra/Array/Internal.hs
@@ -60,18 +60,23 @@
 ) where
 
 import Data.Packed
+import Numeric.Container(konst)
+import Data.Complex
 import Data.List
-import Numeric.LinearAlgebra((<>),Field)
+import Numeric.LinearAlgebra((<>),Field,Normed)
 import Control.Applicative
+--import Control.Arrow ((***))
 import Data.Function(on)
-import Foreign(Storable)
+-- import Foreign(Storable)
 -- import Control.Parallel.Strategies
 import Debug.Trace
 
+ident n = diagRect 0 (konst 1 n) n n
+
 debug m f x = trace (m ++ show (f x)) x
 
 -- | Types that can be elements of the multidimensional arrays.
-class (Num (Vector t), Field t, Storable t) => Coord t
+class (Num (Vector t), Field t, Normed Vector t) => Coord t
 instance Coord Double
 instance Coord (Complex Double)
 
@@ -339,15 +344,19 @@
 
 -------------------------------------------------------------
 
-instance (Coord t, Coord (Complex t), Compat i, Container Vector t) => Container (NArray i) t where
-    toComplex (r,c) = zipArray (curry toComplex) r c
-    fromComplex t = let (r,c) = fromComplex (coords t)
-                     in (mapArray (const r) t, mapArray (const c) t)
-    comp = mapArray comp
-    conj = mapArray conj
-    real = mapArray real
-    complex = mapArray complex
-
+-- instance (Container Vector, Compat i) => ComplexContainer (NArray i) where
+-- --    cmap f (A d v) = A d (cmap f v)
+--     conj (A d v) = A d (conj v)
+--     complex' (A d v) = A d (complex' v) -- mapArray without constraints
+-- 
+--     toComplex (A d1 r, A d2 c)  -- zipArray without constraints
+--         | d1==d2 = A d1 (toComplex (r,c))
+--         | otherwise = error "toComplex on arrays with different structure"
+-- 
+--     fromComplex (A d v) = (A d *** A d) (fromComplex v)
+-- 
+--     single' (A d v) = A d (single' v)
+--     double' (A d v) = A d (double' v)
 
 -- instance (NFData t, Element t) => NFData (NArray i t) where
 --     rnf = rnf . coords
diff --git a/lib/Numeric/LinearAlgebra/Array/Solve.hs b/lib/Numeric/LinearAlgebra/Array/Solve.hs
--- a/lib/Numeric/LinearAlgebra/Array/Solve.hs
+++ b/lib/Numeric/LinearAlgebra/Array/Solve.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Packed.Array.Solve
@@ -154,7 +154,7 @@
     g v = v / atT v [n]
     n = size h t - 1
 
-frobT t = pnorm PNorm2 . coords $ t
+frobT t = realToFrac . pnorm PNorm2 . coords $ t
 --unitT t = t / scalar (frobT t)
 
 dropElemPos k xs = take k xs ++ drop (k+1) xs
@@ -172,7 +172,7 @@
 
 -- | Solution of a multilinear system a x y z ... = b based on alternating least squares.
 mlSolve
-  :: (Compat i, Coord t, Num (NArray i t), Normed (Vector t))
+  :: (Compat i, Coord t, Num (NArray i t))
      => ALSParam i t     -- ^ optimization parameters
      -> [NArray i t]  -- ^ coefficients (a), given as a list of factors.
      -> [NArray i t]  -- ^ initial solution [x,y,z...]
@@ -192,7 +192,7 @@
 
 -- | Solution of the homogeneous multilinear system a x y z ... = 0 based on alternating least squares.
 mlSolveH
-  :: (Compat i, Coord t, Num (NArray i t), Normed (Vector t))
+  :: (Compat i, Coord t, Num (NArray i t))
      => ALSParam  i t    -- ^ optimization parameters
      -> [NArray i t]  -- ^ coefficients (a), given as a list of factors.
      -> [NArray i t]  -- ^ initial solution [x,y,z...]
@@ -232,7 +232,7 @@
 {- | Given two arrays a (source) and  b (target), we try to compute linear transformations x,y,z,... for each dimension, such that product [a,x,y,z,...] == b.
 (We can use 'eqnorm' for 'post' processing, or 'id'.)
 -}
-solveFactors :: (Coord t, Random t, Compat i, Num (NArray i t), Normed (Vector t))
+solveFactors :: (Coord t, Random t, Compat i, Num (NArray i t))
              => Int          -- ^ seed for random initialization
              -> ALSParam i t     -- ^ optimization parameters
              -> [NArray i t] -- ^ source (also factorized)
@@ -264,7 +264,7 @@
 -- [\"pi\",\"qj\", \"rk\", etc.], we try to compute linear transformations
 -- x!\"pi\", y!\"pi\", z!\"rk\", etc. such that product [a,x,y,z,...] == 0.
 solveFactorsH
-  :: (Coord t, Random t, Compat i, Num (NArray i t), Normed (Vector t))
+  :: (Coord t, Random t, Compat i, Num (NArray i t))
      => Int -- ^ seed for random initialization
      -> ALSParam  i t    -- ^ optimization parameters
      -> [NArray i t] -- ^ coefficient array (a), (also factorized)
@@ -287,15 +287,15 @@
 
 -- | post processing function that modifies a list of tensors so that they
 -- have equal frobenius norm
-eqnorm :: (Coord t, Coord (Complex t), Compat i, Num (NArray i t), Normed (Vector t) )
-       => [NArray i t] -> [NArray i t]
+eqnorm :: (Compat i,Show (NArray i Double))
+       => [NArray i Double] -> [NArray i Double]
 
 eqnorm [] = error "eqnorm []"
 eqnorm as = as' where
     n = length as
     fs = map (frobT) as
     s = product fs ** (1/fromIntegral n)
-    as' = zipWith g as fs where g a f = a * real (scalar (s/f))
+    as' = zipWith g as fs where g a f = a * (scalar (s/f))
 
 -- | nMax = 20, epsilon = 1E-3, delta = 1, post = id, postk = const id, presys = id
 defaultParameters :: ALSParam i t
diff --git a/lib/Numeric/LinearAlgebra/Array/Util.hs b/lib/Numeric/LinearAlgebra/Array/Util.hs
--- a/lib/Numeric/LinearAlgebra/Array/Util.hs
+++ b/lib/Numeric/LinearAlgebra/Array/Util.hs
@@ -40,13 +40,13 @@
     renameParts,
     asScalar, asVector, asMatrix, applyAsMatrix,
     fibers, matrixator, matrixatorFree, analyzeProduct,
-    fromVector, fromMatrix,
-    Container(..),
+    fromVector, fromMatrix
+    -- ,Container(..),
 ) where
 
 import Numeric.LinearAlgebra.Array.Internal
 import Numeric.LinearAlgebra.Array.Display
-import Data.Packed(Container(..),Matrix)
+import Data.Packed(Matrix)
 import Numeric.LinearAlgebra.Array.Simple
 import Data.List(intersperse,sort,foldl1')
 
