more ema improvements, file output