Implement the requested functions to cache matrix inversion