add pair& change to cpp