PIP algorithm added