Implemented matrix inversion with caching.