adds pv and fix up main