Rewrote preprocess.py