Caching inverse of matrix