still coding merge function