fleshing out the destroy function