added archiving code to store messages at end of example