Rewrite scripts.js