Removed spurious code. Corrected initialization of p0