Fix a typo.
Refactory code to reduce redundancy.
Merge pull request #55 from zuoshifan/zuo/psestimation

Zuo/psestimation