madd logic update