remove (unused) calc_dist_xyz()
remove unnecessary function dist()
remove unnecessary function largest_dist_idx()
move imports to top