modified function.cpp