re-organizing some jquery and adding comments