minor adjustments to the example code