fix duration and distance (consider first and last segment)