Corrected cpp snippet