code reformat for main.py