mpcg implementation and Test