Update logic in function addIn and addNotIn