Working version with Tkinter