add random matrix generation