fix PS alg
Merge pull request #14 from nov/master

fix PS alg