updated code of example