Moved JavaScript code back into html