adding line by line streaming to file -- needs 3 modes