fixing program to correspond to tests in main.cc