riverdistance function

River Distance