Improve example code by adding some more state