Rewrote a bunch of JavaScript