Updated preprocess script