you get them at start(pointA), then at the end(pointB) the length would be pointB - pointA. for that issue, add an if(pointB<pointA) pointB+=1000

thanks for the ps
gparis