Added Basic  Matrix Caching functionality