cleaned the javascript