Added Tk GUI and refactored all.