Merge function update