had P_WriteAllXYs  right the first time