add script2.js file for refactored code