converted more JS to jQuery