Making cacheable matrix.