updated method.cpp