Merging function version 1.5