implementing functions to cache an inverted matrix