On the long road to fixing index.js. Streamlined the code a little, hopefully it will not cause the page to hang now. Won't be able to test this until I can borrow a server.