returning values are: targetX=foo(0), targetY=foo'(0)