avoid document.writeln(), and use .innerHTML() instead