modified program now uses external cpp file