Tidy up code some more, declare encoding in html file