Changed the writing to support multiple lines