Update main.py

speed improvements and fixes