using while for pv