Adding the functionality for matrix caching of the inverse