Added: document.write console.log, closed function

prints results in browser and user console