Moved script tag to last
Moved inline js into script block