Updated main example to show order of destruction