working on part 2 & modified test.cpp