merge function into main