added logging and html markup functionality