After we have selected the animal that the client want to put up for adoption we need to: 
i) Get the animal object out of the clients pets hash; 
ii) Permanently delete this animal from the clients pets hash; 
ii) Add this animal back to the shelter;

Have a look at the following code which will implement the three points above;

selected_animal = shelter.clients[name].pets.[surrenderAnimal]
selected_animal = shelter.clients[name].pets.delete(surrenderAnimal)
shelter.animals[selected_animal.name] = selected_animal