add writeln fn to write lines to stdout