renamed function html_sg_state_1 to html_sg_state_a