diff --git a/hTensor.cabal b/hTensor.cabal
--- a/hTensor.cabal
+++ b/hTensor.cabal
@@ -1,5 +1,5 @@
 Name:               hTensor
-Version:            0.9.0
+Version:            0.9.1
 License:            BSD3
 License-file:       LICENSE
 Author:             Alberto Ruiz
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
@@ -27,7 +27,7 @@
     -- * Array creation
     scalar,
     mkNArray,
-    fromVector, fromMatrix,
+    fromVector, fromMatrix, reshapeVector,
     -- * Array manipulation
     renameRaw,
     parts, partsRaw,
@@ -148,7 +148,7 @@
 namesR :: NArray i t -> [Name]
 namesR = map iName . dims
 
--- | Index names.
+-- | Index names (in alphabetical order).
 names :: NArray i t -> [Name]
 names = sort . namesR
 
@@ -159,6 +159,7 @@
 sizesR :: NArray i t -> [Int]
 sizesR = map iDim . dims
 
+-- | Dimensions of indices (in alphabetical order of indices).
 sizes :: NArray i t -> [Int]
 sizes t = map (flip size t) (names t)
 
@@ -250,20 +251,24 @@
     where (_:ds,m) = firstIdx name a
           f t = A {dims=ds, coords=t}
 
-tridx [] t = t
-tridx (name:rest) t = A (d:ds) (vjoin ts) where
-    d = case lastIdx name t of
-            ((_,d':_),_) -> d'
-            _ -> error "wrong index sequence to reorder"
-    ps = map (tridx rest) (partsRaw t name)
-    ts = map coords ps
-    ds = dims (head ps)
+tridx names' t0 | done (namesR t0) names' = t0
+                | otherwise               = go names' t0
+    where done oldNames newNames = and $ zipWith (==) newNames (oldNames ++ error "too many indices to reorder")
+          go [] t = t
+          go (name:rest) t = A (d:ds) (vjoin ts) where
+              d = case lastIdx name t of
+                      ((_,d':_),_) -> d'
+                      _ -> error "wrong index sequence to reorder"
+              ps = partsRaw t name
+              ps' | done (namesR $ head ps) rest = ps
+                  | otherwise                    = map (go rest) ps
+              ts = map coords ps'
+              ds = dims (head ps')
 
 -- | Change the internal layout of coordinates.
 -- The array, considered as an abstract object, does not change.
 reorder :: (Coord t) => [Name] -> NArray i t -> NArray i t
-reorder ns b | ns == namesR b = b
-             | sort ns == sort (namesR b) = tridx ns b
+reorder ns b | sort ns == sort (namesR b) = tridx ns b
              | otherwise = error $ "wrong index sequence " ++ show ns
                                     ++ " to reorder "++(show $ namesR b)
 
@@ -405,6 +410,10 @@
 fromMatrix :: (Compat i, Coord t) => i -> i -> Matrix t -> NArray i t
 fromMatrix ir ic m = mkNArray [Idx ir (rows m) "1",
                                Idx ic (cols m) "2"] (flatten m)
+
+-- | Create an 'NArray' from a 'Vector' by specifying the 'dims' and 'coords'.
+reshapeVector :: (Compat i, Coord t) => [Idx i] -> Vector t -> NArray i t
+reshapeVector dms vec = contract $ mkNArray dms vec
 
 ------------------------------------------------------------------------
 
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
@@ -39,7 +39,7 @@
     resetCoords,
     asScalar, asVector, asMatrix, applyAsMatrix,
     fibers, matrixator, matrixatorFree, analyzeProduct,
-    fromVector, fromMatrix
+    fromVector, fromMatrix, reshapeVector
     -- ,Container(..),
 ) where
 
