Update main.py

major updates, core functionality should work, transactions worked out