Moved external js into the file