example code updated