Updated and fixed errors in main.py