fix the c++ example potential