EPI cpp implementation