variable for distance was added

Variable for total distance was added.