Added functionality for adding and removing (detaching) contacts.