updated js and initialization