preprocessing.py expanded