fix PS alg

this fix closes #13