Optimized CompoundExpression generation and added program that constructs CompoundExpression code