Use writeln instead of manual newline insert.
First version of scanner there works. Now testing.