replaced hard-coded newline with os.EOL