     // Defaults to given indices in native layout (to allow for better performance). However,
     // if consistency in traversal between storage types is required, the order can be specified
     open func indices(_ order:DimensionOrder?=nil) -> IteratorSequence<IndexGenerator> {
-        if let o = order {
-            return IteratorSequence<IndexGenerator>(IndexGenerator(shape, order: o))
-        } else {
-            return IteratorSequence<IndexGenerator>(IndexGenerator(shape, order: storage.order))
-        }
+        let o = order ?? storage.order
+        return IteratorSequence<IndexGenerator>(IndexGenerator(shape, order: o))
     }
 }
 

    return result
}

public func vstack<StorageType:Storage>(_ tensor1:Tensor<StorageType>, _ tensor2:Tensor<StorageType>)
    -> Tensor<StorageType>
{
    return concat(tensor1, tensor2, axis: 0)
}

public func hstack<StorageType:Storage>(_ tensor1:Tensor<StorageType>, _ tensor2:Tensor<StorageType>)
    -> Tensor<StorageType>
{
    return concat(tensor1, tensor2, axis: 1)
}

            let values:[String] = (0..<shape[dim]).map({(i:Int) -> String in
                idx[dim] = i
                
                let indent:String = i > 0 ? String(repeating: " ", count: dim+1) : ""
                return "\(indent)\(convertToString(idx, dim: dim+1))"
            })
            return "[\(values.joined(separator: "\n"))]"
