two functions used to cache the inverse of a matrix