adding and removing references