fixed the js and made it simple