Cpp example was a bit different. Fixed