implement with newLine as argument
simplify tests
add test cases