Changes to calculate length of the tour