implement --merge, --frame and --stack1 options.