updated the distance