modified cpp program