fixed create_matrix, changed reformatting matrix, added threshold statistics in matrix_stats