wrote file for reading input and handling newlines