new merge function, using doALS