updated preprocess script