updated cut.cpp