small changes to the clean up code in examples.