added python way ...
updated cpp way ...