changed \p command to P and other small changes