You should not be adding the pet to the client object from the shelter. Your adoption function should simply delete the pet and return the deleted pet at the end of the function. The relationship between the shelter and the client can then be defined outside of both classes. Neither of the classes should modify the data of the other.