complete two functions for caching inverse matrix