adding matrix and matrix cacher