Almost there, the main issue remaining is when running from a command-line, it sometimes "unwraps" lines.