C++ implementation of EMK from Liefeng Bo, ing..