Change destination to a vector:

VECTOR destination;

Remove the if conditions with destination.

After the trace:
vec_set(destination, target);