finally moved the javascript into it's own file