o add quit.py to exit main prog
o update filename generation
o tidy up code