updated code in example