fixed ptv.py