Implemented matrix caching.