organized code in 'script.js'