initial implementation for sequence_plan_far wrapper function, plus some cleanup