code migrated back to Python2.7 and PyQt4