Update opentiles.py

cleaner. global//mains appropriated.