update cw logic