script.js optimized