Original Source code from: xpmsrc01.zip