Update Main.py

Main refactor.