updated example code - 2