Distance calculation added