modified for cppide