Moved js into its own file