Tidy up some code

Add jquery library