checked the example code