modified example code