added random matrix generator