support recursive apperence of the goal node
almost done