PF algorithm