updated CachyMatrix code