batch correction function (m-file) update