Fix most of the second round of edits, add some javascript