caching an inverse of matrix