Moment Distribution C++ Version