updated example code