reorganize main.py to allow parallel processing on doall using multiprocessing