Adding the code to generate or update the node