adds functions for caching inverse matrix computations