fork of original phamlp in https://code.google.com/p/phamlp/