update js and data structure