Caching the inverse of a matrix solved