beginnings of porting main.py