rewrite of pathcalc.py using tkinter, and some cleanup