more work on cpp code