edited merge function style