Added the cacheable matrix implementation.