Resolving duplicate new lines