minor modification of class.cpp