Code from Set Listener site

This has been cut and pasted...