moved a bunch of js to html for less clutter