Full functionality for merging nodes