Caching inverse of a matrix