make sure x is a matrix in cocheSolve function.