Added the code format for implementing 'merging nodes'