rewriting main.py