Update main.py

new state system
pause feature