Update main.py

Cleaned up code a bit