Updated/simplified example code.