Update main.py

Many changes done offline and inserted back here at once. Full functional version on Pandora.