Add method to handle new lines
refector after passing test
added nr 4