Created function to cache the inversion of a matrix