Fixing out-of-order bug caused by not using passed-back index in forEach
Giving DOM pane back its javascript