Update opentiles.py

somewhat clean; global//main vars appropriated