edited create_matrix and added output files