implement postprocessing in plan.ml (incomplete)