changed most things to JQuery