changed condition

if i+1 < nrow --> will leave out critical data points from the last
movement
if i + 1 <= nrow should calculate all distances moved.