added make matrix dictionary in mem