cpp: more work on diagram