fixed p(k) zero-removal error