move flattenTermsTwo before AddHeatingConditions for maude backend and go back to beginning for java backend