udpate code snippet