Added missing total distance code
Merge remote-tracking branch 'origin/master'