added --merge option