Modified functions to cache the inverse of a matrix instead of the mean.