tweaks to the p2 algorithm -- still not correct