beautified the tkinter code