Moved the javascript to its own file