rewrote the javascript application.js