Re-organised Main.py