Improving HTML output, preparing for palette output