started jquery, condensed some code