implement pretty printer for closure-converted forms
fix flattening