convert rest to cpp