added cpp routines