added hw2b.cpp