Added implementation of caching the inverse of a matrix.