Preprocessing script