Moved JavaScript to external file