C++ version
Merge pull request #2 from gugus/master

C++ version