Mi cpp implementation