We can use references here.    Also, let's create a merged element on stack and then put it in `rpn` if the merge succeeds -- when modifying in place, we can leave some rubbish, especially if some field is added in the future.