     precondition(x.rows == y.rows && x.columns == y.columns, "Matrix dimensions not compatible with addition")
 
     var results = y
-    cblas_daxpy(Int32(x.grid.count), 1.0, x.grid, 1, &(results.grid), 1)
+    cblas_daxpy(Int32(x.elements.count), 1.0, x.elements, 1, &(results.elements), 1)
 
     return results
 }
 
 public func mul(alpha: Float, x: Matrix<Float>) -> Matrix<Float> {
     var results = x
-    cblas_sscal(Int32(x.grid.count), alpha, &(results.grid), 1)
+    cblas_sscal(Int32(x.elements.count), alpha, &(results.elements), 1)
 
     return results
 }
 
 public func mul(alpha: Double, x: Matrix<Double>) -> Matrix<Double> {
     var results = x
-    cblas_dscal(Int32(x.grid.count), alpha, &(results.grid), 1)
+    cblas_dscal(Int32(x.elements.count), alpha, &(results.elements), 1)
 
     return results
 }

public struct Matrix<T where T: FloatingPointType, T: FloatLiteralConvertible> {
    public typealias Element = T

    let rows: Int
    let columns: Int
    var grid: [Element]

    public init(rows: Int, columns: Int, repeatedValue: Element) {
        self.rows = rows
        self.columns = columns

        self.grid = [Element](count: rows * columns, repeatedValue: repeatedValue)
    }

    public init(_ contents: [[Element]]) {

    precondition(x.columns == y.rows, "Matrix dimensions not compatible with multiplication")

    var results = Matrix<Double>(rows: x.rows, columns: y.columns, repeatedValue: 0.0)
    cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, Int32(x.rows), Int32(y.columns), Int32(x.columns), 1.0, x.elements, Int32(x.columns), y.elements, Int32(y.columns), 0.0, &(results.elements), Int32(results.columns))

    return results
}
