Creates the matrix