gui almost done. Next - algorithms for distance calculation