add partial support for flattening kappa-expressions (mostly commented out)