minor changes to generate cross expansion code