add randMat to generate random matrix