print_mat updated