Why the code of removing an item is the same as adding an item?