dont overwrite input file as you read it