udpated mode and output file