optimization script done in processing.py