wrote 2 functions to store a matrix and its inverse in a cached list and to get the matrices from cache