caching inversion of matrix