Distance checking working