minor modifications in PVfunctions.cpp.