the matrix inverse caching function