inverse of a matrix using cache