Mergenodes function added to mergetree