Lots of code Refinement, updated jquery