inverse of matrix using cache