deletes old code that was commented out
moves scripting and index checking to same function, and scrolls to bottom of screen after page load