added commit_mat