updated the example code