more snippets. fixed c++ style