updated code example