clean.py improved