more selective tkinter import
bug fix for distance calculation