working cp.cpp w/o timer