trying to generate plan from code