update speed and distance