Updated HTML format, added javascript function