caching an inverse matrix