thanks for the tip! i  will implement after 12 OCT 2008 as i am going to USA and Canada for holiday.

i  have not used "+=" before

At constraint page add the following lines:
d+= Math.sqrt((x-xs)*(x-xs)+(y-ys)*(y-ys));  [b][color=blue]// what is += ??  is it a syntax for line integral of absolute value of displacement.[/color][/b]

that is so cool!