modifications to line-by-line i/o