11/19 minor modification, added flushFile in CHF