attempted 2-2.cpp