Adding distance computation