various changes so the HTML-visible code actually runs