Update distance.func.php