Rewrote project using several .js files