rewriting in python + tkinter, beginning of conversion