V7

cpp implementation