init distance and speed