finished cleaning up the main.py code for compliance with python 3 standards