modified the use of tolerance in PVfunctions.cpp.