added console output in addition to writing the html file
made writing to an html file optional