updated with new example code