updated index.html, added write wrapper