split main.py into two classes; added some new functions