updated cpp snippets