merge funcitons.
merge function.