updated pwin.cpp