refactored test.cpp so that it is now composed of multiple methods