bug fixes to XPEHH and plotting for XPEHH