js and cpp changes