distance script