caching inverse matrix